0
\$\begingroup\$

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.

\$\endgroup\$

5 Answers 5

5
\$\begingroup\$

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.

\$\endgroup\$
2
\$\begingroup\$

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.

\$\endgroup\$
9
  • 1
    \$\begingroup\$ 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. \$\endgroup\$
    – Blue
    Apr 18, 2012 at 18:20
  • 1
    \$\begingroup\$ 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. \$\endgroup\$
    – House
    Apr 18, 2012 at 18:30
  • \$\begingroup\$ 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. \$\endgroup\$
    – House
    Apr 18, 2012 at 18:31
  • 1
    \$\begingroup\$ 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. \$\endgroup\$
    – House
    Apr 18, 2012 at 18:57
  • 1
    \$\begingroup\$ Because the project set up is different for each. Read the document you posted. \$\endgroup\$
    – House
    Apr 18, 2012 at 19:13
2
\$\begingroup\$

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.

\$\endgroup\$
0
\$\begingroup\$

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.

\$\endgroup\$
-2
\$\begingroup\$

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

\$\endgroup\$
2
  • \$\begingroup\$ 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 \$\endgroup\$
    – floAr
    Nov 14, 2013 at 6:53
  • \$\begingroup\$ Considering the emulator works, it's probably not an issue with the emulator settings. \$\endgroup\$
    – House
    Nov 14, 2013 at 14:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .