I keep getting this error in Android Studio when I run my app on an Android phone. I have spent several weeks trying to fix it and have implemented the following measures:
Added android name to be
android:name="android.support.multidex.MultiDexApplication"
Added source compatibility as follows:
compileOptions sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8
Declared proguard +multidex file with list of extra classes
Made changes to root level gradle file by adding urls in the repositories and then changed the order of calling the repos
Updated android IDE and android studio, android sdk platform tools. gradle build files
Copied all the libraries from .idea/libs folder to GSDemo/apps/libs folder
Created a new libs folder in project root and copied all the libraries’ jar files into it
Disabled instant run
Moved the codes from java subfolder to src folder
Invalid cache/restart
Below is the error I get:
java.lang.NoClassDefFoundError: Failed resolution of:
Ldji/common/mission/waypoint/WaypointMissionFinishedAction;
at googlemap.gsdemo.dji.com.gsdemo.MainActivity.(MainActivity.java:81)
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1086)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2843)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3049)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1646)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6836)
at java.lang.reflect.Method.invoke(Native Method)