How to get LibGDX gradled eclipse project to work

2019-06-18 07:03发布

问题:

I am trying to get libgdx gradle project to work on AIDE. AIDE is an app on android that acts like a IDE. It doesnt seems to work as the buildconfig.java does not have the package name generated. Anyone have any workaround?

回答1:

Ok, I've got my project compiling. What I did was...

  1. Created a new LibGDX project under AIDE.
  2. Left all the folder names as they were. i.e. gdx-game, gdx-game-android.
  3. Using adb I pushed all my files into these respective folders. e.g. core = gdx-game, android = gdx-game-android
  4. I also had to copy in a .classpath from another working test LibGDX app I'd created in AIDE previously, as this time round there wasn't one.

Et Voila!

At least it's working for me.



回答2:

Seems that AIDE's got a new interative course on using libGDX



回答3:

Here is my solution:

First copy core/src folder to android/src folder Then copy libs folder from a project to android folder

Only problem i had was libgdx.jar file of Aide was older version.I downloaded latest version of gdx and copied jar files to libs folder.



回答4:

@thhVictor, "It doesnt seems to work as the buildconfig.java does not have the package name generated"

It's because AIDE tries to treat regular java project (which is LibGdx project named "core") as android project. You can check it youself navigating to core/ directory and see that AIDE shows option "open this Android App project" instead of "Open this Java project". After opening and clicking "run" you'll see your error

You have 2 options:

  1. gradle-based https://github.com/Deepscorn/libgdx-gradle-template/blob/master/README.md#aide

  2. eclise project files based http://deepscorn.blogspot.ru/2016/07/building-and-running-android-studio.html

Both requires to do things by hand. But I prefer gradle-based because it's modern thing and so I hope AIDE devs will make support for regular java projects which are gradle-based