Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
firebase安装后未打开颤振应用程序_Firebase_Flutter - Fatal编程技术网

firebase安装后未打开颤振应用程序

firebase安装后未打开颤振应用程序,firebase,flutter,Firebase,Flutter,我已经在我的应用程序中安装了firebase插件并复制了google-service.json文件,但当我运行应用程序时,它不会打开 我只有一个插件,cloud\u firestore:^0.13.7 我的应用程序级别build.gradle文件是 def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile

我已经在我的应用程序中安装了firebase插件并复制了google-service.json文件,但当我运行应用程序时,它不会打开

我只有一个插件,
cloud\u firestore:^0.13.7

我的应用程序级别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.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    compileSdkVersion 28

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.rotaryadyar"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        multiDexEnabled true

    }

    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 'com.google.firebase:firebase-analytics:17.2.2'
    implementation 'com.android.support:multidex:1.0.3'

}

安装firebase和google文件后,其显示一些错误,然后我添加此multidexEnabled,然后错误不显示,但在应用程序构建后,其未打开

您是否尝试过使缓存无效并重新启动android studio?我遇到了这个问题,之后我的应用程序正在运行或降低到0.13.6版

您是否尝试过使其无效缓存并重新启动android studio我遇到了这个问题,之后我的应用程序正在运行或降低到0.13.6版,可能是集成没有完成

修改android/build.gradle文件和android/app/build.gradle文件,以添加Firebase助手描述的Google服务插件。确保您的android/build.gradle文件包含maven.google.com,如下所述

我个人建议您遵循firebase_消息包的集成步骤1-3,这些步骤类似:

  • 使用Firebase控制台将Android应用程序添加到您的项目中:按照助手的指示,下载生成的
    google services.json
    文件,并将其放置在
    Android/app

  • 将类路径添加到[project]/android/build.gradle文件中

  • 将应用插件添加到[project]/android/app/build.gradle文件中


  • 请注意:集成明确表示将
    apply插件:“com.google.gms.google services”
    放在文件末尾。但是你在文件的中间。可能这是您的错误。

    可能是集成未完成

    修改android/build.gradle文件和android/app/build.gradle文件,以添加Firebase助手描述的Google服务插件。确保您的android/build.gradle文件包含maven.google.com,如下所述

    我个人建议您遵循firebase_消息包的集成步骤1-3,这些步骤类似:

  • 使用Firebase控制台将Android应用程序添加到您的项目中:按照助手的指示,下载生成的
    google services.json
    文件,并将其放置在
    Android/app

  • 将类路径添加到[project]/android/build.gradle文件中

  • 将应用插件添加到[project]/android/app/build.gradle文件中


  • 请注意:集成明确表示将
    apply插件:“com.google.gms.google services”
    放在文件末尾。但是你在文件的中间。可能这是您的错误。

    尝试
    颤振运行--verbose
    如果您收到错误消息,它也没有显示任何错误最后一行是等待天文台端口可用。。。当我简单地运行它时,它只是在安装apptry时停止运行--verbose如果你得到错误消息,它也没有显示任何错误最后一行是在等待observatory端口可用。。。当我简单地运行它时,它只是停止安装应用程序
    dependencies {
      // Example existing classpath
      classpath 'com.android.tools.build:gradle:3.5.3'
      // Add the google services classpath
      classpath 'com.google.gms:google-services:4.3.2'
    }
    
    // ADD THIS AT THE BOTTOM
    apply plugin: 'com.google.gms.google-services'