这个项目在更新到 ADT22 之前创造了奇迹。我已经失去了一天,因为不知道我必须下载构建工具,我担心我会因为这个而失去另一个。
当我尝试构建两天前工作的相同代码时,我得到了这个异常:
com.cidaut.blueparking fatal error : Unable to instantiate activity \
ComponentInfo{com.cidaut.blueparking/com.cidaut.blueparking.SplashScreen_}: \
java.lang.ClassNotFoundException: \
Didn't find class "com.cidaut.blueparking.SplashScreen_" on path: \
/data/app/com.cidaut.blueparking-1.apk
java.lang.RuntimeException: Unable to instantiate activity \
ComponentInfo{com.cidaut.blueparking/com.cidaut.blueparking.SplashScreen_}: \
java.lang.ClassNotFoundException: \
Didn't find class "com.cidaut.blueparking.SplashScreen_" on path: \
/data/app/com.cidaut.blueparking-1.apk
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2106)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: \
Didn't find class "com.cidaut.blueparking.SplashScreen_" on path: \
/data/app/com.cidaut.blueparking-1.apk
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
... 11 more
实际上,我发现它试图在 APK 文件中查找类很奇怪,但无论如何。有什么解决办法吗?
顺便说一句,我的类路径包括 AndroidAnnotations 生成代码的源文件夹,所以这不是问题。
这是我的订单和导出窗口
AndroidAnnotations 类生成错误日志
编辑:现在它正在工作
我遵循的程序是这样的:
- 清理并重建一切
- 检查每个项目(主项目和库)的“订购和导出”选项卡上的所有内容
- 再次清理并重建一切
现在可以了。我不敢相信我因此失去了将近 12 个小时……