我无法让Crashlytics与Amazon Fire TV一起使用。我有一个针对Android,Android TV和FireTV的项目。 Crashlytics似乎在Android和Android TV上都可以正常工作,但是我在运行它时遇到了错误,说它在初始化期间超时。
这是错误:
04-16 12:30:11.051 6661-6661/com.acompany.app.firetvclient E/CrashlyticsCore: Crashlytics timed out during initialization.
java.util.concurrent.TimeoutException
at java.util.concurrent.FutureTask.get(FutureTask.java:176)
at com.crashlytics.android.core.CrashlyticsCore.finishInitSynchronously(CrashlyticsCore.java:727)
at com.crashlytics.android.core.CrashlyticsCore.onPreExecute(CrashlyticsCore.java:298)
at com.crashlytics.android.core.CrashlyticsCore.onPreExecute(CrashlyticsCore.java:211)
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:466)
at io.fabric.sdk.android.Fabric.init(Fabric.java:410)
at io.fabric.sdk.android.Fabric.setFabric(Fabric.java:368)
at io.fabric.sdk.android.Fabric.with(Fabric.java:339)
at com.crashlytics.android.CrashlyticsInitProvider.onCreate(CrashlyticsInitProvider.java:27)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1696)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1671)
at android.app.ActivityThread.installProvider(ActivityThread.java:5340)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4935)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4861)
at android.app.ActivityThread.access$1500(ActivityThread.java:160)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1382)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5597)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:984)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
这是我的项目的build.gradle文件和firetv目标:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
maven{
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'io.fabric.tools:gradle:1.28.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven {
url "https://maven.fabric.io/public"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.acompay.app.firetvclient"
minSdkVersion 22
targetSdkVersion 28
versionCode 260
versionName "2.6.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildToolsVersion '28.0.3'
}
dependencies {
compileOnly files('libs/amazon-device-messaging-1.0.1.jar')
implementation files('assets/api_key.txt')
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:leanback-v17:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9'
implementation project(':bftools')
}
apply plugin: 'com.google.gms.google-services'
我需要为Fire TV设置不同的Crashlytics吗?我真的不明白为什么会收到该错误。