4

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?

user1132959
  • 978
  • 8
  • 16
  • Make sure your main activity package defined in Manifest file and your checked out package are same. – kosa Jan 05 '12 at 20:06
  • 1
    Try cleaning and rebuilding the project. – Peter Knego Jan 05 '12 at 20:14
  • Likely related to http://stackoverflow.com/questions/8538891/bad-class-file-magic-when-using-dx-bat (but there are no responses) –  Jan 05 '12 at 20:40
  • I tried cleaning and it didn't work. I tried changing the compiler to 1.6 (it was on 1.6 on old computer) and that didn't work. Maybe I should try removing the .class files from the svn server? – user1132959 Jan 05 '12 at 21:05
  • 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! – user1132959 Jan 05 '12 at 21:23
  • Also I couldn't post it as an answer yet since I'm a new user, so if anyone else would like to copy paste it as an answer. Thanks. – user1132959 Jan 05 '12 at 21:24
  • Please post your solution as an answer and then accept it later. This way, people in the future will be able to easily see what the solution was :) Glad you figured it out. –  Jan 05 '12 at 22:35
  • Just removing the project and readding it to the Eclipse solved the issue for me. – riwnodennyk Feb 27 '13 at 14:31

1 Answers1

3

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!

user1132959
  • 978
  • 8
  • 16