Firebase助手无法启动(Flutter)

mklgxw1f  于 2023-05-18  发布在  Flutter
关注(0)|答案(3)|浏览(129)

我似乎无法让Firebase Assistant在Android Studio中工作,并获得以下错误。


java. util. com.谷歌。很普通收集。Iterators $www.example.com(Iterators.java:81)at com.谷歌。服务。firebase。DependencyStateManager。getDependencyState(DependencyStateManager.java:60)at com.谷歌。服务。firebase。DependencyStateManager。在com.android.tools.idea.assistant.view.StatefulButton.处初始化(DependencyStateManager.java:109)。(StatefulButton.java:122)at com.android.tools.idea.assistant.view.TutorialStep.(TutorialStep.java:106)at com.机器人工具主意。助理风景教学卡。在com.android.tools.idea.assistant.view.TutorialCard上重绘(TutorialCard.java:153)。(TutorialCard.java:90),网址为com.android.tools.idea.assistant.view.FeaturesPanel。(FeaturesPanel.java:84),网址为com.android.tools.idea.assistant.AssistSidePanel。(AssistSidePanel.java:81)在com.机器人工具主意。助理AssistToolWindowFactory。createToolWindowContent(AssistToolWindowFactory.java:37)at com.android.tools.idea.assistant.OpenAssistSidePanelAction.lambda$openWindow$0(OpenAssistSidePanelAction.java:59)at com.智力openapi。应用TransactionGuardImpl $1.next www.example.com(EventDispatchThread.java:82) www.example.com (TransactionGuardImpl.java:315) at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:424) at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run (LaterInvocator.java:407) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762) at java.awt.EventQueue.access$500(EventQueue.java:98) at java.awt.EventQueue$3.run (EventQueue.java:715) at java.awt.EventQueue$3.run (EventQueue.java:709) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.awt.EventQueue.dispatchEvent(EventQueue.java:732) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:822) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:650) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:366) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at www.example.com (EventDispatchThread.java:82)
我已经安装了所需的所有插件和SDK工具,包括:
Google RepositoryFirebase App IndexingFirebase ServicesFirebase Testing
我的配置如下。

    • build. 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
}
    • app/build. 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'
    • pubspec. 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

p8h8hvxi

p8h8hvxi1#

我也有同样的问题。我去设置>插件,然后删除所有3个firebase插件。重新启动。返回插件,添加所有3个firebase插件。重新启动。然后它工作得很好!

bq9c1y66

bq9c1y662#

我也遇到了这个问题,并通过更新所有内容解决了它:

  • Android Studio 3.1 -> 3.2
  • 我已经安装的所有SDK工具(工具> SDK管理器> SDK工具)
  • Flutter和Dart插件(首选项>插件)

我还尝试了Justin的方法,卸载Firebase插件,重新启动,然后重新安装。
完成所有操作后,重新启动Android Studio,让IDE完成所有索引和其他任务,然后打开Firebase助手(工具> Firebase)

yhived7q

yhived7q3#

为了一个Flutter项目。首先,在项目设置中删除您的Firebase应用程序,然后单击删除此应用程序,然后转到项目的路径并粘贴这些命令。
命令1:dart pub global activate flutterfire_cli
命令2:flutterfire configure --project=YOUR PROJECT NAME

相关问题