Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

So I finished tweaking a tutorial called Rain Catcher and I ran the desktop application. It works fine. I then proceeded to run the application using the android emulator the game then crashes.

I set up the project using libGDX's project set-up.

Why won't it run properly on the android emulator even though it runs fine on the desktop application?

enter image description here

I don't know if you can see it but if you zoom you would be able to see it easier.

share|improve this question
add comment

5 Answers

up vote 5 down vote accepted

If the Android project compiles correctly but is missing classes when run, it may be because ADK r17 (the current version atm) doesn't include the external game project as part of the build. There's an extra step you have to do that's still lacking from most of the existing documentation for project setup. It's described here. Copying from that site, the steps are:

  1. Click on your Android Project
  2. Select Properties
  3. Select Java Build Path
  4. Select Order and Export
  5. Check all your references, e.g. the gdx.jar, the gdx-backend-android.jar, your main code project etc.

The pictures on the site are helpful, so go check that out.

share|improve this answer
add comment

Had the same problem, realized i did not have the "Use host GPU" box checked on the emulator.

share|improve this answer
    
Hey Yocko, please mind that this page is for providing answers to questions. Posts like 'I did this the same' are generally not ment for answers. If you want to post something like this, consider making it a comment –  floAr Nov 14 '13 at 6:53
    
Considering the emulator works, it's probably not an issue with the emulator settings. –  Byte56 Nov 14 '13 at 14:00
add comment

The behavior is odd because since you don't get a compile error on Drop.java, it appears that you have your project set up properly. For the Dalvik DexClassLoader to fail, it appears that something is getting messed up in the build process. If you really want to investigate, take the .apk and run it through dex2jar and open it with a Java Decomplier and see if there are classes missing.

If the classes are there, it would suggest to me that you have problems with your development environment. Either Java/JVM, your Android SDK or the build of libgdx you have is corrupt. Since it works in the Java Project like you said, one would think that maybe trying to reinstall the Android SDK may resolve your issues.

share|improve this answer
add comment

Generally, this problem (missing GDX libraries at run-time on Android) is because the "libs" directory isn't setup exactly as specified in the project doc. The directory must be called "libs" and it must contain the GDX backend and both sets of ARM libraries.

share|improve this answer
add comment

It's unable to resolve the superclass for Lcom/badlogic/drop/Drop and unable to resolve Lcom/badlogic/gdx/backends/android/AndroidApplication

So I'd say there's an issue with the badlogic library. You may want to read the text files it wrote out to see their stack traces. Perhaps that'll give you more of a clue.

Did you look at the "Running the game on Android" section of the documentation you linked? Are you sure the AndroidApplication backend is present?

You really need to start investigating these types of errors on your own BluFire.

share|improve this answer
1  
The thing is that most errors come from other errors. So I don't know the root of the problem, all i know is that my application wont work and that there are a lot of errors. –  Blue Apr 18 '12 at 18:20
1  
I know, it takes time to get comfortable with it. It's just that with these types of problems, you're the best person to solve these. You're hands on, and can more easily trace things back to a common issue. Compare your version to a non-tweaked version. What kind of differences are there? Problems like this are typically not in the code, they're in the project setup. Check out those settings first. –  Byte56 Apr 18 '12 at 18:30
    
Also, you should post the errors as text, that way, when people search for this issue in the future, they're more likely to find it. –  Byte56 Apr 18 '12 at 18:31
1  
Well that's good, if it worked before you changed things then you know where the problem is. It's in the code you changed. That's the first place you should look. Whenever you're changing code, you should make the changes as incremental as possible and build in-between to ensure you haven't broken anything. I know you don't know the root of the problem. That's where in investigation part comes in. People here don't just automatically know what the root issue is, they look at the logs and trace the problem back to its source. –  Byte56 Apr 18 '12 at 18:57
1  
Because the project set up is different for each. Read the document you posted. –  Byte56 Apr 18 '12 at 19:13
show 4 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.