Android emulator crash: “Dx bad class file magic” / ClassNotFoundException on startup?

拥有回忆 提交于 2019-12-04 03:50:13

问题


I am developing a game in android and I have an issue. I have the game fully functioning on my other computer so I committed the project to an svn server to use on my new windows 7 64 bit computer. I checked it out on my new computer with subversive in eclipse. Obviously I had some issues with the build paths so I fixed those and the project was error free. When I go to run it on an emulator running android 2.3.3 it crashes at startup with a ClassNotFoundException for the main activity. I have everything correct in the manifest.
When I run it, if I had just cleaned it, I get warnings that say Dx bad class file magic (cafebabe) or version (0033.0000) on every class file (Otherwise I dont get those warnings) and I think that might be why it is crashing at startup. I've looked everywhere and tried different things but nothing.
Another important thing to note is that I was able to create an android project from a sample in eclipse on my new computer and everything ran perfectly fine. So for some reason svn screwed things up? Thanks for the help, let me know if any more info is needed.

EDIT: Forgot to mention that I have another project that was in svn that I am using as a framework and the game references that project. Maybe they are compiling as different java versions?


回答1:


Figured it out thanks to comments that were left! The other framework project I had was referenced by my game project like I mentioned in the edit. It turns out that the sdk level on that framework was 1.7 instead of the 1.6 like it should have been even though the game project was 1.6. For some reason android didn't detect that and it threw everything out of whack. After I changed every project to 1.6 and cleaned every project it worked! Thanks!



来源:https://stackoverflow.com/questions/8748977/android-emulator-crash-dx-bad-class-file-magic-classnotfoundexception-on-st

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!