gpt4 book ai didi

导致应用程序崩溃的 Android Fabric crashlytics

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:51:29 31 4
gpt4 key购买 nike

由于 Fabric Crashlytics,我遇到了奇怪的崩溃。我正在使用织物的 crashlytics。但是当我在 S5 5.0 API 21 上运行应用程序时,它会导致整个应用程序崩溃。

查看下面的报告:

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/crashlytics/android/core/CrashlyticsCore;
at com.crashlytics.android.Crashlytics.<init>(Crashlytics.java:29)
at com.projectname.application.AppData.onCreate(AppData.java:162)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1020)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5010)
at android.app.ActivityThread.access$1600(ActivityThread.java:172)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1482)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5835)
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:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.crashlytics.android.core.CrashlyticsCore" on path: DexPathList[[zip file "/data/app/com.projectname-2/base.apk", zip file "/data/app/com.projectname-2/split_lib_dependencies_apk.apk", zip file "/data/app/com.projectname-2/split_lib_slice_0_apk.apk", zip file "/data/app/com.projectname-2/split_lib_slice_1_apk.apk", zip file "/data/app/com.projectname-2/split_lib_slice_2_apk.apk", zip file "/data/app/com.projectname-2/split_lib_slice_3_apk.apk", zip file "/data/app/com.projectname-2/split_lib_slice_4_apk.apk", zip file "/data/app/com.projectname-2/split_lib_slice_5_apk.apk", zip file "/data/app/com.projectname-2/split_lib_slice_6_apk.apk", zip file "/data/app/com.projectname-2/split_lib_slice_7_apk.apk", zip file "/data/app/com.projectname-2/split_lib_slice_8_apk.apk", zip file "/data/app/com.projectname-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.packagename-here-2/lib/arm, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at com.crashlytics.android.Crashlytics.<init>(Crashlytics.java:29)
at com.packagename--here.application.AppData.onCreate(AppData.java:162)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1020)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5010)
at android.app.ActivityThread.access$1600(ActivityThread.java:172)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1482)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5835)
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:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
Suppressed: java.lang.ClassNotFoundException: com.crashlytics.android.core.CrashlyticsCore
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 14 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

这是我的 gradle 文件:

 buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}

dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
repositories {
maven {
url "https://jitpack.io"
maven { url 'https://github.com/500px/500px-android-blur/raw/master/releases/' }
}
maven { url 'https://maven.fabric.io/public' }
mavenCentral()
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'


repositories {
maven { url 'https://maven.fabric.io/public' }
}



apply plugin: 'android-apt'
android {
lintOptions {
disable 'MissingTranslation'
checkReleaseBuilds false
}
packagingOptions {
exclude 'META-INF/rxjava.properties'
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
compileSdkVersion 25
buildToolsVersion '25.0.3'
defaultConfig {
applicationId "--package--name"
minSdkVersion 19
targetSdkVersion 25
versionCode 23
versionName "2.6"
multiDexEnabled true
}

buildTypes {
release {

minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {


}
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:multidex:1.0.1'

compile 'com.jakewharton:butterknife:8.4.0'
apt 'com.jakewharton:butterknife-compiler:8.4.0'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
// retrofit, gson
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.squareup.retrofit2:retrofit:2.2.0'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.github.angads25:filepicker:1.0.6'
compile 'io.reactivex:rxjava:1.0.16'
// Progress loader
compile 'com.wang.avi:library:2.1.3'
//Stetho debug
compile 'com.facebook.stetho:stetho:1.4.2'
//Stetho OkHttp3
//compile 'com.facebook.stetho:stetho-okhttp3:1.4.2'
compile project(':facebook-android-sdk-4.16.1')
compile project(':linkedin-sdk')
compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
transitive = true;
}
compile 'com.google.android.gms:play-services:9.8.0'
// image picker
compile 'com.github.darsh2:MultipleImageSelect:3474549'
// instabug
compile 'com.instabug.library:instabug:3+'
compile 'com.github.recruit-lifestyle:WaveSwipeRefreshLayout:1.6'
compile 'com.facebook.fresco:fresco:1.3.0'
compile 'com.borjabravo:readmoretextview:2.0.1'
compile 'com.squareup.retrofit2:adapter-rxjava2:2.2.0'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
// Because RxAndroid releases are few and far between, it is recommended you also
// explicitly depend on RxJava's latest version for bug fixes and new features.
compile 'io.reactivex.rxjava2:rxjava:2.0.1'
compile project(':versioninfo')
}


apply plugin: 'com.google.gms.google-services'

应用程序在启动时崩溃。
我也尝试过 multidex,但仍然存在一些问题。

最佳答案

这种错误通常与MultiDex的使用有关

查看您的代码并验证(尤其是第 2 点):

1) 您已将 multidex 支持添加到您的应用中:

compile 'com.android.support:multidex:1.0.1'

2) 您已将您的应用程序设置为 MultiDex 应用程序

public class MyApplication extends Application {

protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}

// Your application implementation here
}

3) 您已将 multiDexEnabled true 设置添加到您的 build.gradle 文件中:

defaultConfig {
// Other settings here
multiDexEnabled true
}

关于导致应用程序崩溃的 Android Fabric crashlytics,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45795644/

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