mardi 3 mars 2015

Didn't find main class on DexPathList



First of all, please don't mark this as a duplicate; I've gone through all of the suggested posts as well as done my own googling on this.


I have no idea what is going on, a deadline is approaching and I need help ASAP.


This problem first started after I exported my app as a signed APK (right-click export in Eclipse). When I ran my APK, it crashed and said it couldn't find the main class. After deleting the APK from my phone, I edited the manifest file to read com.gordon.status.main.Status, instead of just main.Status


Before I tried to export it as a signed APK, everything was working perfectly. Now it won't work at all.


I tried running it again, and I got the same error.


Over the course of almost two days now, I've tried:



  • Refreshing, cleaning, rebuilding all projects in Eclipse

  • Unchecking and checking the Android Private Libraries and Android Dependencies

  • Removing unnecessary libraries

  • Deleting the bin & gen folders

  • Renaming com.gordon.status.main.Status back to main.Status

  • Making sure other libraries that use android-support (v4 & v7) point to the same jar

  • Reformating my phone and testing it on a virtual machine


What is going on?? Here is the exact error:



03-03 19:08:42.559: E/AndroidRuntime(14677): Process: com.gordon.status, PID: 14677
03-03 19:08:42.559: E/AndroidRuntime(14677): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.gordon.status/main.Status}: java.lang.ClassNotFoundException: Didn't find class "main.Status" on path: DexPathList[[zip file "/data/app/com.gordon.status-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.gordon.status-1, /vendor/lib, /system/lib]]
03-03 19:08:42.559: E/AndroidRuntime(14677): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2310)
03-03 19:08:42.559: E/AndroidRuntime(14677): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2497)
03-03 19:08:42.559: E/AndroidRuntime(14677): at android.app.ActivityThread.access$900(ActivityThread.java:168)
03-03 19:08:42.559: E/AndroidRuntime(14677): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1306)
03-03 19:08:42.559: E/AndroidRuntime(14677): at android.os.Handler.dispatchMessage(Handler.java:102)
03-03 19:08:42.559: E/AndroidRuntime(14677): at android.os.Looper.loop(Looper.java:146)
03-03 19:08:42.559: E/AndroidRuntime(14677): at android.app.ActivityThread.main(ActivityThread.java:5678)
03-03 19:08:42.559: E/AndroidRuntime(14677): at java.lang.reflect.Method.invokeNative(Native Method)
03-03 19:08:42.559: E/AndroidRuntime(14677): at java.lang.reflect.Method.invoke(Method.java:515)
03-03 19:08:42.559: E/AndroidRuntime(14677): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
03-03 19:08:42.559: E/AndroidRuntime(14677): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
03-03 19:08:42.559: E/AndroidRuntime(14677): at dalvik.system.NativeStart.main(Native Method)
03-03 19:08:42.559: E/AndroidRuntime(14677): Caused by: java.lang.ClassNotFoundException: Didn't find class "main.Status" on path: DexPathList[[zip file "/data/app/com.gordon.status-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.gordon.status-1, /vendor/lib, /system/lib]]
03-03 19:08:42.559: E/AndroidRuntime(14677): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:67)
03-03 19:08:42.559: E/AndroidRuntime(14677): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
03-03 19:08:42.559: E/AndroidRuntime(14677): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
03-03 19:08:42.559: E/AndroidRuntime(14677): at android.app.Instrumentation.newActivity(Instrumentation.java:1067)
03-03 19:08:42.559: E/AndroidRuntime(14677): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2301)
03-03 19:08:42.559: E/AndroidRuntime(14677): ... 11 more


Part of manifest containing launcher activity:



<activity android:name="main.Status" android:label="@string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="oauth" android:host="status"/>
</intent-filter>
</activity>



Aucun commentaire:

Enregistrer un commentaire