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
Android 无法获取FirebaseInitProvider异常_Android_Firebase - Fatal编程技术网

Android 无法获取FirebaseInitProvider异常

Android 无法获取FirebaseInitProvider异常,android,firebase,Android,Firebase,这个id是我的gradle文件,我无法解决这个问题。我刚刚更新了Google服务和存储库,之后我收到这个错误,无法获取FirebaseInitProvider 我尝试了multidexenable=true并设置了MultiDexInstall(这个)在Multidex应用程序中,我仍然遇到相同的异常情况,是否有人可以帮助我。尽管您已尝试启用Multidex,但它似乎没有正确配置。您配置应用程序类的方式很可能有问题。如果由于Multidex以外的原因,您不需要对应用程序进行子类化,只需使用提供的

这个id是我的gradle文件,我无法解决这个问题。我刚刚更新了Google服务和存储库,之后我收到这个错误,无法获取FirebaseInitProvider


我尝试了
multidexenable=true
并设置了
MultiDexInstall(这个)在Multidex应用程序中,我仍然遇到相同的异常情况,是否有人可以帮助我。

尽管您已尝试启用Multidex,但它似乎没有正确配置。您配置
应用程序
类的方式很可能有问题。如果由于Multidex以外的原因,您不需要对
应用程序
进行子类化,只需使用提供的
MultiDexApplication
并使用以下行修改清单的
应用程序
元素:

          apply plugin: 'com.android.application'

          android {
      compileSdkVersion 25
      buildToolsVersion "25.0.0"
      defaultConfig {
      applicationId "com.emperors.raaste"
      minSdkVersion 16
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    multiDexEnabled=true
}
buildTypes {
    release {
        multiDexEnabled=true
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    packagingOptions {
        exclude 'libs/jackson-core-asl-1.9.13.jar'
        exclude 'libs/jackson-mapper-asl-1.9.13.jar'
        exclude 'META-INF/ASL2.0'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'

    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_7

}
}

  dependencies {
  compile fileTree(include: ['*.jar'], dir: 'libs')
  androidTestCompile('com.android.support.test.espresso:espresso-        core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile files('libs/map_sdk_2.0.jar')
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.android.support:support-v4:25.0.1'
compile 'com.android.support:design:25.0.1'
compile 'com.android.support:support-annotations:25.0.1'
compile 'com.google.android.gms:play-services-auth:10.0.1'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.firebase:firebase-storage:10.0.1'
compile 'com.theartofdev.edmodo:android-image-cropper:2.3.+'
compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.firebase:firebase-invites:10.0.1'
compile 'com.google.firebase:firebase-ads:10.0.1'
testCompile 'junit:junit:4.12'
compile 'com.google.code.gson:gson:2.4'
compile 'com.squareup.picasso:picasso:2.3.2'
compile 'com.android.support:support-vector-drawable:25.0.1'
compile 'com.android.support:recyclerview-v7:25.0.1'
compile 'com.android.support:multidex:1.0.1'
}




apply plugin: 'com.google.gms.google-services'
否则,请按照中的说明从
MultiDexApplication
扩展应用程序类

当Multidex正确配置并工作时,您将在
logcat
中看到如下消息:

android:name="android.support.multidex.MultiDexApplication"

虽然你的应用程序的当前配置包含超过65K个方法引用,因此需要为棒棒糖前的设备使用多索引,但你可能能够消除这一点。您对
com.google.android.gms:play services:10.0.1
的依赖正在吸引所有的play services API。它们位于标题为“选择性地将API编译到可执行文件”的部分中。删除
com.google.android.gms:play services:10.0.1
,并用您需要的特定API替换它。这将提高构建时间,使APK更小,并可能消除对Multidex的需要。

这似乎是“Multidex 64K方法”的问题。该应用程序适用于Android API级别>=21的情况,但如果您的MinSDK版本<21,则应遵循以下说明:

  • 在“android defaultConfig”中添加“multiDexEnabled true”
  • 在“依赖项”中添加“compile'com.android.support:multidex:1.0.1”
  • 在清单中的应用程序标记中添加“android:name=“android.support.multidex.MultiDexApplication”,或者在重写应用程序类时,将“extends application”更改为“extends MultiDexApplication”
以下是官方页面的链接:

I/MultiDex: install
I/MultiDex: MultiDexExtractor.load(/data/app/com.qbix.multidextest-10.apk, false)
I/MultiDex: Detected that extraction must be performed.
I/MultiDex: install done