gpt4 book ai didi

android - Crashlytics 找不到我的 Fabric.properties

转载 作者:行者123 更新时间:2023-12-02 21:03:00 24 4
gpt4 key购买 nike

我正在尝试在我的应用程序中设置 Crashlytics,但收到消息 java.lang.IllegalArgumentException:无法初始化 Fabric,AndroidManifest.xml 中缺少 API key 。将以下标签添加到您的应用程序元素,但我不想将我的 key 放在 androidManifest 中,所以我必须创建 Fabric.properties,对吧?到目前为止我的设置就是这样。

Fabric.properties 位于 /app/fabric.properties

apiKey=XXXXXXXXXXXXXXXXXX

在Application类的OnCreate()上初始化。

private void setupCrashlytics(){
CrashlyticsCore core = new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build();
Fabric.with(this, new Crashlytics.Builder().core(core).build());

}

gradle中设置依赖

apply plugin: 'com.android.application'
apply plugin: 'idea'
apply plugin: 'witness'
apply plugin: 'io.fabric'

android {
compileSdkVersion 27
buildToolsVersion '26.0.2'
dataBinding.enabled = true
useLibrary 'org.apache.http.legacy'

defaultConfig {
applicationId "com.douglas"
minSdkVersion 14
targetSdkVersion 27
versionCode 31
versionName "0.4.4"
multiDexEnabled true
ndk {
abiFilters "armeabi-v7a", "x86", "armeabi", "mips"
}
}
buildTypes {
release {
debuggable false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
ext.enableCrashlytics = false
}
debug {
debuggable true
minifyEnabled false
ext.enableCrashlytics = false
}
beta {
debuggable true
signingConfig signingConfigs.debug
ext.enableCrashlytics = true
}

}
sourceSets {
main {
jniLibs.srcDir file('jniLibs')
assets.srcDirs = ['assets']
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:27.0.2'
compile 'com.android.support:preference-v7:27.0.2'
compile 'com.android.support:support-v4:27.0.2'
compile 'com.android.support:cardview-v7:27.0.2'
compile 'com.android.support:recyclerview-v7:27.0.2'
compile 'com.android.support:gridlayout-v7:27.0.2'
compile 'com.android.support:design:27.0.2'
compile 'com.j256.ormlite:ormlite-core:4.48'
compile 'net.zetetic:android-database-sqlcipher:3.5.7@aar'
compile 'com.google.guava:guava:20.0'
compile 'org.thoughtcrime.ssl.pinning:AndroidPinning:1.0.0'
compile 'com.loopj.android:android-async-http:1.4.8'
compile 'com.google.code.gson:gson:2.8.0'
compile 'org.jsoup:jsoup:1.8.2'
compile 'com.viewpagerindicator:library:2.4.1'
compile 'com.mobsandgeeks:android-saripaar:2.0.3'
compile('com.crashlytics.sdk.android:crashlytics:2.8.0@aar') {
transitive = true
}
}

最佳答案

我在 fabric gradle 插件 1.25.4 中遇到了同样的问题,在将 Fabric gradle 版本更新到 1.31.0 后似乎已修复

classpath 'io.fabric.tools:gradle:1.31.0'

感谢这个 stackoverflow 答案:https://stackoverflow.com/a/57206074/6671572

关于android - Crashlytics 找不到我的 Fabric.properties,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48463201/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com