Dalvik 弄乱了库代码,项目无法再运行

发布于 2024-12-18 07:06:08 字数 2490 浏览 2 评论 0原文

在我的机器上更新 ADT 和 Android SDK 后,我的所有项目都出现错误。

现在我有这个:

PS:运行具有 jar 作为依赖项的项目时会发生此错误(它是用 proguard 编译的,我们没有原始源代码来再次编译它)。

W/dalvikvm(3497): VFY: unable to resolve static field 994 (storeicon) in Lcom/ww/dgs/R$drawable;
D/dalvikvm(3497): VFY: replacing opcode 0x60 at 0x0042
W/dalvikvm(3497): VFY: unable to resolve static field 987 (libraryicon) in Lcom/ww/dgs/R$drawable;
D/dalvikvm(3497): VFY: replacing opcode 0x60 at 0x0060
W/dalvikvm(3497): VFY: unable to resolve static field 1069 (mainframe) in Lcom/ww/dgs/R$layout;
D/dalvikvm(3497): VFY: replacing opcode 0x60 at 0x00b1
I/dalvikvm(3497): DexOpt: unable to optimize static field ref 0x0467 at 0x16 in Lcom/ww/sharedlibrary/e;.a
D/AndroidRuntime(3497): Shutting down VM
W/dalvikvm(3497): threadid=1: thread exiting with uncaught exception (group=0x400f8760)
E/AndroidRuntime(3497): FATAL EXCEPTION: main
E/AndroidRuntime(3497): java.lang.NoClassDefFoundError: com.ww.dgs.R$layout
E/AndroidRuntime(3497):     at com.ww.mainframe.MainFrame.onCreate(Unknown Source)
E/AndroidRuntime(3497):     at com.ww.iba.DigiMag.onCreate(DigiMag.java:27)
E/AndroidRuntime(3497):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
E/AndroidRuntime(3497):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1715)
E/AndroidRuntime(3497):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1767)
E/AndroidRuntime(3497):     at android.app.ActivityThread.access$1500(ActivityThread.java:122)
E/AndroidRuntime(3497):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1005)
E/AndroidRuntime(3497):     at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(3497):     at android.os.Looper.loop(Looper.java:132)
E/AndroidRuntime(3497):     at android.app.ActivityThread.main(ActivityThread.java:4028)
E/AndroidRuntime(3497):     at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(3497):     at java.lang.reflect.Method.invoke(Method.java:491)
E/AndroidRuntime(3497):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
E/AndroidRuntime(3497):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
E/AndroidRuntime(3497):     at dalvik.system.NativeStart.main(Native Method)
I/dalvikvm(3497): threadid=4: reacting to signal 3
I/dalvikvm(3497): Wrote stack traces to '/data/anr/traces.txt'

com.ww 中的代码位于我在其他版本中使用的 jar 内。

After updating ADT and Android SDK on my machine, all my projects get errors.

Now I have this:

PS: This error happens when running the project that have a jar as dependency (it was compiled with proguard and we dont have the original sourcecode to compile it again).

W/dalvikvm(3497): VFY: unable to resolve static field 994 (storeicon) in Lcom/ww/dgs/R$drawable;
D/dalvikvm(3497): VFY: replacing opcode 0x60 at 0x0042
W/dalvikvm(3497): VFY: unable to resolve static field 987 (libraryicon) in Lcom/ww/dgs/R$drawable;
D/dalvikvm(3497): VFY: replacing opcode 0x60 at 0x0060
W/dalvikvm(3497): VFY: unable to resolve static field 1069 (mainframe) in Lcom/ww/dgs/R$layout;
D/dalvikvm(3497): VFY: replacing opcode 0x60 at 0x00b1
I/dalvikvm(3497): DexOpt: unable to optimize static field ref 0x0467 at 0x16 in Lcom/ww/sharedlibrary/e;.a
D/AndroidRuntime(3497): Shutting down VM
W/dalvikvm(3497): threadid=1: thread exiting with uncaught exception (group=0x400f8760)
E/AndroidRuntime(3497): FATAL EXCEPTION: main
E/AndroidRuntime(3497): java.lang.NoClassDefFoundError: com.ww.dgs.R$layout
E/AndroidRuntime(3497):     at com.ww.mainframe.MainFrame.onCreate(Unknown Source)
E/AndroidRuntime(3497):     at com.ww.iba.DigiMag.onCreate(DigiMag.java:27)
E/AndroidRuntime(3497):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
E/AndroidRuntime(3497):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1715)
E/AndroidRuntime(3497):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1767)
E/AndroidRuntime(3497):     at android.app.ActivityThread.access$1500(ActivityThread.java:122)
E/AndroidRuntime(3497):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1005)
E/AndroidRuntime(3497):     at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(3497):     at android.os.Looper.loop(Looper.java:132)
E/AndroidRuntime(3497):     at android.app.ActivityThread.main(ActivityThread.java:4028)
E/AndroidRuntime(3497):     at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(3497):     at java.lang.reflect.Method.invoke(Method.java:491)
E/AndroidRuntime(3497):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
E/AndroidRuntime(3497):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
E/AndroidRuntime(3497):     at dalvik.system.NativeStart.main(Native Method)
I/dalvikvm(3497): threadid=4: reacting to signal 3
I/dalvikvm(3497): Wrote stack traces to '/data/anr/traces.txt'

The code from com.ww is inside a jar that I used on the other builds.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

ゃ懵逼小萝莉 2024-12-25 07:06:08

我现在也遇到了这个问题,并且可以通过从项目中删除所有外部 jar 来解决它。清洁后您可以将它们添加回去。我假设您可以访问原始项目源代码...

右键单击项目,转到 Java 构建路径,然后删除除 Android 库之外的所有外部 jar。然后清洁。

I am getting this too now and am able to get around it by removing all external jars from the project. You can add them back in after it's been cleaned. I'm assuming you have access to the original project source code...

Rightclick on project, go to Java Build Path, and remove all external jars other than your Android libs. Then clean.

把梦留给海 2024-12-25 07:06:08

更新到 Android Platform Tools Preview 15 rc5 和 Android Tools 21 rc5 并在 eclipse 中运行“检查更新...”后出现此错误。

LogCat 错误

java.lang.NoClassDefFoundError: com.someapplicationlibrary.lib.R$layout

Eclipse 编译器错误:

Errors occurred during the build.
Errors running builder 'Android Pre Compiler' on project 'myApplication'.
String index out of range: -51
Errors running builder 'Android Pre Compiler' on project 'someapplicationlibrary'.
String index out of range: -54

尝试恢复到稳定的 Android 工具...但最终出现更多错误。

我的解决方案是在 eclipse 版本中加载工作区,该版本未使用 eclipse 帮助菜单中的“检查更新...”进行更新。

然后它编译正确,应用程序再次运行,希望这有帮助:)

Got this error after updating to the Android Platform Tools preview 15 rc5 and Android Tools 21 rc5, plus running the "check for updates..." in eclipse.

LogCat error

java.lang.NoClassDefFoundError: com.someapplicationlibrary.lib.R$layout

Eclipse compiler error:

Errors occurred during the build.
Errors running builder 'Android Pre Compiler' on project 'myApplication'.
String index out of range: -51
Errors running builder 'Android Pre Compiler' on project 'someapplicationlibrary'.
String index out of range: -54

Tried to revert to the stabel Android Tools... but ending up with even more errors.

My solution was to load the workspace in a eclipse version that was not updated with the "check for updates..." in the eclipse Help menu.

Then it compiled correct, and the application worked again, hope this helps:)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文