java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.me.hexavoidaa/com.me.hexavoidaa.PTPlayer}: java.lang.ClassNotFoundException: Didn\'t fin
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
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
In Android 9 likely to help adding to manifest into "application" tag:
<uses-library
android:name="org.apache.http.legacy"
android:required="false" />
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'
}