我似乎无法让FireBase助手在Android Studio中工作并得到以下错误。
无效的
java.util.nosuchelementexception位于
Copy.Cuff.Copy.迭代器1美元.下一步(迭代器. Java:81)AT
谷歌.Services,FialBase.依赖关系StaseMeNavaG.GETAsRealEngyType(RealNeCyStestMeAgAdv.java:60)
在
谷歌.Services .FielBase. AsvestCyStEnMeNANGER .init(RealNeCyStestMeAgAdv.java:109)
在
COM.Android .Too.View .Audio.View。StuteFultButo..(StaseFultButo.java:122)
在
com工具,视图,视图(106)
在
COM.Android .Too.View .Audio.View .TutoLoCAR.ReDead(TooLogalCAR.java:153)
在
COM.Android .Too.View .Audio.View . TutorialCard .(TutoRoalCAR.java:90)
在
COM.Android .Too.View .Audio.View。
在
COM.Android .Too.Vo.Addio.AssisiDeNeNel.(AuthsiDeNeel.java:81)
在
COM.Android。工具。
在
COM.Android。工具。想法。助理。OpenAssisiDePaNeleActual.lambda $ OpenWindows 0美元(OpenAssisiDePaNelActudi.java:59)
在
com .OpenelAPI .Apdio.TraceActudiActudiPL 2美元.运行(TraceActudiaPrimP.java:315)
在
COM.ITELIJ.OpenAPI。应用程序。IMPL.RealVoCuult$FLUSCHeQue.RunNeXTEVER(RealViuCuto.java:424)
在
COM.ITELIJ.OpenAPI。应用程序。IMPL。
在Java事件处理器上进行调度(Java:311)
在Java.AWT.EnvestQue.Debug 762中
Java.AWT.EngEngQue.Access 500美元(EngestQue.java:98)AT
Java.AWT.EnvestReal$$ 3 .运行(EngestQue.java:715)AT
Java.AWT.EnvestReal$$ 3 .运行(EngestQue.java:709)AT
Java.Security .Access控制器。
Java.Security .保护域$JavaCururyAccess .dodoSecurity特权(保护域. Java:80)
在Java.AWT.EnvestQue.Debug队列(EnvivQue.java:732)AT
iTelij.ID.ItEnjistQueal.DeFultDebug事件(IDENESTQueQue.java:822)
在
iTelij.ID.ItEnjistQueal.x Debug事件(IDENESTQueQue.java:650)
在
ItEclij.ID.ItEnvestQueal.Debug事件(IDENESTQueQue.java:366)
在
Java.AWT.EvestDebug线程.PopPoEnEngEfFuffes(EvestDebug线程.java:201)
在
Java.AWT.EvestDebug线程.CopyEvsFraceFrutter(EnvithDebug线程.java:116)
在
Java.AWT.EvestDebug线程.CopyEvestsFrase:EvestDebug线程.java:105)
在
Java.AWT.EvestDebug线程.BuffEvices(EvestDebug线程.java:101)
在
Java.AWT.EvestDebug线程.BuffEvices(EvestDebug线程.java:93)
在Java.AWT.EvestDebug线程.Run(EvestDebug线程.java:82)
我已经安装了所需的所有插件和SDK工具,包括:Google Repository
Firebase App Indexing
Firebase Services
Firebase Testing
我的配置如下。
建筑.gradle
buildscript {
ext.kotlin_version = '1.2.31'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:3.2.0' // google-services plugin
}
}
allprojects {
repositories {
google()
jcenter()
maven {
url "https://maven.google.com" // Google's Maven repository
}
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
应用程序/构建.gradle
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 27
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.networks.hn"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
compile 'com.google.firebase:firebase-core:12.0.1'
compile 'com.google.firebase:firebase-core:12.0.1'
compile 'com.google.firebase:firebase-storage:12.0.1'
compile 'com.google.firebase:firebase-auth:12.0.1'
compile 'com.google.firebase:firebase-messaging:12.0.1'
compile 'com.google.firebase:firebase-database:12.0.1'
}
apply plugin: 'com.google.gms.google-services'
公共规范Yaml
dependencies:
flutter:
sdk: flutter
intl: "^0.15.2"
flutter_localizations:
sdk: flutter
redux: "^2.1.1"
flutter_redux: "^0.3.5"
transparent_image: "^0.1.0"
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.0
# Cloudstore Firebase
cloud_firestore: ^0.3.2
当我尝试在应用程序中集成任何FireBase时,我会收到一系列编译错误,当我删除这些代码时,这些错误就会消失。我怀疑我配置错误或者某个地方存在版本冲突。
我正在运行Android Studio 3.1
最佳答案
我也有同样的问题。我转到设置>插件,然后删除所有3个FireBase插件。重新启动。回到插件,添加所有3个FireBase插件。重新启动。然后它工作得很好!