Thursday, February 2, 2017

Relationship between Desktop and Android on LibGDX


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.



Answer



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.


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...