此问题首先在我将应用程序导出为已签名的APK(在Eclipse中右键单击导出)后开始。当我运行我的APK时,它崩溃并说它无法找到主要类。从手机中删除APK后,我将清单文件编辑为com.gordon.status.main.Status
,而不只是main.Status
在我尝试将其导出为已签名的APK之前,一切都运行良好。现在它根本没有工作。
我尝试再次运行它,我得到了同样的错误。
在将近两天的时间里,我已经尝试过了:
com.gordon.status.main.Status back to main.Status
发生什么事了?这是确切的错误:
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
包含启动器活动的清单的一部分:
<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>