我已经在我的应用上使用了Firebase和Fabric一段时间了,我今天尝试集成它们并且我收到了错误消息。我看到了一堆有相同错误的问题,但所有答案都谈到了Fabric插件或者我不再需要的东西,至少基于集成的设置说明。
我下载了新的google-services.json
我已经有了最新的这个:
classpath 'com.google.gms:google-services:3.1.1'
我已经拥有Google Maven回购。
我已经拥有Firebase核心。
我补充说:
compile('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') {
transitive = true
}
我已经获得了谷歌服务的apply plugin
行。
这是我所做的唯一更改,但我也尝试删除:
maven { url 'https://maven.fabric.io/public' }
classpath 'io.fabric.tools:gradle:1.+'
apply plugin: 'io.fabric'
但得到了同样的例外。
我正在我的应用程序类onCreate
中初始化Fabric,如下所示:
Fabric.with(this, new Crashlytics());
那么我做错了什么?
例外:
java.lang.RuntimeException: Unable to create application mypackage.MyApp: io.fabric.sdk.android.services.concurrency.UnmetDependencyException: This app relies on Crashlytics. Please sign up for access at https://fabric.io/sign_up,
install an Android build tool and ask a team member to invite you to this app's organization.
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5743)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: io.fabric.sdk.android.services.concurrency.UnmetDependencyException: This app relies on Crashlytics. Please sign up for access at https://fabric.io/sign_up,
install an Android build tool and ask a team member to invite you to this app's organization.
at com.crashlytics.android.core.CrashlyticsCore.onPreExecute(CrashlyticsCore.java:233)
at com.crashlytics.android.core.CrashlyticsCore.onPreExecute(CrashlyticsCore.java:207)
at io.fabric.sdk.android.InitializationTask.onPreExecute(InitializationTask.java:44)
at io.fabric.sdk.android.services.concurrency.AsyncTask.executeOnExecutor(AsyncTask.java:611)
at io.fabric.sdk.android.services.concurrency.PriorityAsyncTask.executeOnExecutor(PriorityAsyncTask.java:43)
at io.fabric.sdk.android.Kit.initialize(Kit.java:69)
at io.fabric.sdk.android.Fabric.initializeKits(Fabric.java:440)
at io.fabric.sdk.android.Fabric.init(Fabric.java:384)
at io.fabric.sdk.android.Fabric.setFabric(Fabric.java:342)
at io.fabric.sdk.android.Fabric.with(Fabric.java:313)
at mypackage.MyApp.onCreate(MyApp.java:738)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5740)
... 8 more
编辑:我也改变了:
<meta-data
android:name="com.crashlytics.ApiKey"
android:value="mykey"/>
要:
<meta-data
android:name="io.fabric.ApiKey"
android:value="mykey" />
答案 0 :(得分:1)
将google-services
版本更新为最新版本: -
classpath 'com.google.gms:google-services:3.2.0'