java.lang.ClassNotFoundException in dalvik.system.BaseDexClassLoader.findClass

后端 未结 4 890
無奈伤痛
無奈伤痛 2020-12-06 16:25
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.me.hexavoidaa/com.me.hexavoidaa.PTPlayer}: java.lang.ClassNotFoundException: Didn\'t fin         


        
相关标签:
4条回答
  • 2020-12-06 16:26

    In some cases, this could be a MultiDex issue. Try this in your application class. That is in App.java which extends Application:

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this); // this is the key code
    }
    

    source: https://github.com/opendatakit/collect/issues/387

    0 讨论(0)
  • 2020-12-06 16:33

    if you already added multidex in both gradle and manifest then try to disable instant run and then create apk to test, i was facing same issue and searched a lot and tried every solution but at last this solved my problem

    0 讨论(0)
  • 2020-12-06 16:34

    In Android 9 likely to help adding to manifest into "application" tag:

    <uses-library
            android:name="org.apache.http.legacy"
            android:required="false" />
    
    0 讨论(0)
  • 2020-12-06 16:49

    add this to gradle.build:

    defaultConfig {
    ...
    minSdkVersion 14
    targetSdkVersion // your version 
    ...
    
    // Enabling multidex support.
    multiDexEnabled true
    }
    
    dependencies {
      compile 'com.android.support:multidex:1.0.0'
    }
    
    • follow android developers page's instruction: https://developer.android.com/studio/build/multidex.html
    0 讨论(0)
提交回复
热议问题