姬長信(Redy)

如何修复android 4.4.2错误ClassNotFoundException:…


AndroidRuntime: FATAL EXCEPTION: main
  Process: com.info.app, PID: 24503
  java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.provider.FirebaseInitProvider" on path: DexPathList[[zip file "/data/app/com.info.app-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.info.app-1, /vendor/lib, /system/lib]]
      at android.app.ActivityThread.installProvider(ActivityThread.java:5236)
      at android.app.ActivityThread.installContentProviders(ActivityThread.java:4827)
      at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4710)
      at android.app.ActivityThread.access$1600(ActivityThread.java:174)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1367)
      at android.os.Handler.dispatchMessage(Handler.java:102)
      at android.os.Looper.loop(Looper.java:146)
      at android.app.ActivityThread.main(ActivityThread.java:5593)
      at java.lang.reflect.Method.invokeNative(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:515)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
      at dalvik.system.NativeStart.main(Native Method)
   Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.provider.FirebaseInitProvider" on path: DexPathList[[zip file "/data/app/com.info.app-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.info.app-1, /vendor/lib, /system/lib]]
      at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:67)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
      at android.app.ActivityThread.installProvider(ActivityThread.java:5221)
      at android.app.ActivityThread.installContentProviders(ActivityThread.java:4827)?
      at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4710)?
      at android.app.ActivityThread.access$1600(ActivityThread.java:174)?
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1367)?
      at android.os.Handler.dispatchMessage(Handler.java:102)?
      at android.os.Looper.loop(Looper.java:146)?
      at android.app.ActivityThread.main(ActivityThread.java:5593)?
      at java.lang.reflect.Method.invokeNative(Native Method)?
      at java.lang.reflect.Method.invoke(Method.java:515)?
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)?
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)?
      at dalvik.system.NativeStart.main(Native Method)?

的build.gradle:

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

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    mavenCentral()
    maven() {
        url "https://oss.sonatype.org/content/repositories/snapshots"
    }
    maven { url 'https://maven.fabric.io/public' }

}

android {
    dexOptions {
        javaMaxHeapSize "4g"
    }

    compileSdkVersion 25
    buildToolsVersion '25.0.1'
    defaultConfig {
        // Enabling multidex support.
        multiDexEnabled true
        applicationId "com.info.app"
        minSdkVersion 17
        targetSdkVersion 25
        versionCode 16
        versionName "1.0.12"
        testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            debuggable false
            signingConfig signingConfigs.config
        }
        debug {
            debuggable true
            signingConfig signingConfigs.config
        }
    }

    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile project(':CustomBrowser-release')
    compile project(':PayU-release')
    compile project(':sdkui')

    compile('com.github.worker8:tourguide:1.0.17-SNAPSHOT@aar') {
        transitive = true
    }
    compile('com.twitter.sdk.android:twitter:2.3.2@aar') {
        transitive = true;
    }
    compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
        transitive = true;
    }
    compile 'com.intuit.sdp:sdp-android:1.0.4'
    compile 'com.android.support:appcompat-v7:25.0.1'
    compile 'com.android.support:cardview-v7:25.0.1'
    compile 'com.android.support:design:25.0.1'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
    compile 'com.soundcloud.android:android-crop:1.0.1@aar'
    compile 'com.mcxiaoke.volley:library:1.0.19'
    compile 'com.google.code.gson:gson:2.2.4'
    compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
    compile 'de.hdodenhof:circleimageview:2.0.0'
    compile 'com.google.android.gms:play-services:10.2.4'
    compile 'com.facebook.android:facebook-android-sdk:4.15.0'
    compile 'com.google.firebase:firebase-messaging:10.2.4'
    compile 'com.nononsenseapps:filepicker:3.1.0'
    compile 'com.ufreedom.uikit:FloatingViewLib:1.0.2'
    compile 'com.github.paolorotolo:appintro:4.1.0'
    compile 'com.google.firebase:firebase-crash:10.2.4'
    compile 'com.google.firebase:firebase-appindexing:10.2.4'
    compile 'com.stripe:stripe-android:3.1.1'
    compile 'com.braintreepayments:card-form:3.0.5'
    compile 'com.daimajia.numberprogressbar:library:1.4@aar'
    testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

MyApplication.java:

public class MyApplication extends Application {

      @Override
      public void onCreate() {
          MultiDex.install(getApplicationContext());
          super.onCreate();

AndroidManifest.xml中:


不幸的是,只有app在Android下面停止了4.4.

最新日志文件:

06-17 16:50:36.955 586-586/? I/SELinux: Function: selinux_android_load_priority [0], There is no sepolicy file.

06-17 16:50:37.005 586-586/? I/SELinux: Function: selinux_android_load_priority , spota verifySig and checkHash pass. priority version is VE=SEPF_GT-I9192_4.4.2_0055

06-17 16:50:37.005 586-586/? I/SELinux: selinux_android_seapp_context_reload: seapp_contexts file is loaded from /data/security/spota/seapp_contexts
06-17 16:50:37.005 586-586/? E/dalvikvm: >>>>> Normal User
06-17 16:50:37.005 586-586/? E/dalvikvm: >>>>> com.info.app [ userId:0 | appId:10286 ]
06-17 16:50:37.005 586-586/? D/dalvikvm: Late-enabling CheckJNI
06-17 16:50:37.415 586-586/com.info.app D/AndroidRuntime: Shutting down VM
06-17 16:50:37.415 586-586/com.info.app W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x41ea2da0)
06-17 16:50:37.415 586-586/com.info.app E/AndroidRuntime: FATAL EXCEPTION: main
  Process: com.info.app, PID: 586
  java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.provider.FirebaseInitProvider" on path: DexPathList[[zip file "/data/app/com.info.app-3.apk"],nativeLibraryDirectories=[/data/app-lib/com.info.app-3, /vendor/lib, /system/lib]]
      at android.app.ActivityThread.installProvider(ActivityThread.java:5236)
      at android.app.ActivityThread.installContentProviders(ActivityThread.java:4827)
      at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4710)
      at android.app.ActivityThread.access$1600(ActivityThread.java:174)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1367)
      at android.os.Handler.dispatchMessage(Handler.java:102)
      at android.os.Looper.loop(Looper.java:146)
      at android.app.ActivityThread.main(ActivityThread.java:5593)
      at java.lang.reflect.Method.invokeNative(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:515)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
      at dalvik.system.NativeStart.main(Native Method)
   Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.provider.FirebaseInitProvider" on path: DexPathList[[zip file "/data/app/com.info.app-3.apk"],nativeLibraryDirectories=[/data/app-lib/com.info.app-3, /vendor/lib, /system/lib]]
      at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:67)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
      at android.app.ActivityThread.installProvider(ActivityThread.java:5221)
      at android.app.ActivityThread.installContentProviders(ActivityThread.java:4827)?
      at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4710)?
      at android.app.ActivityThread.access$1600(ActivityThread.java:174)?
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1367)?
      at android.os.Handler.dispatchMessage(Handler.java:102)?
      at android.os.Looper.loop(Looper.java:146)?
      at android.app.ActivityThread.main(ActivityThread.java:5593)?
      at java.lang.reflect.Method.invokeNative(Native Method)?
      at java.lang.reflect.Method.invoke(Method.java:515)?
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)?
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)?
      at dalvik.system.NativeStart.main(Native Method)?