1

I have libGDX projects on one laptop. I need to move to another laptop. I am using eclipse on both windows laptops. I have a git repo I can push to and pull from. I know that I can clone the https://github.com/libgdx/libgdx-demo-cuboc and import it into eclipse as a gradle project. But when I try this with my libGDX projects the "Build Model" fails.

enter image description here

I suspect I did not export the project correctly from my source laptop. Can someone please point out what I am doing wrong?

Update:

OK. When I exported the projects from Eclipse I exported as plain old Android projects (Export Android Application), so I figured that I should export the project as Generate Gradle build files but I get this error when I attempt to do so ...

enter image description here

... and yes I did this too ...

enter image description here

... and I still get the same error.

UPDATE: After accepting JH's answer. Thank you for your answer BTW.

I was able to copy files in the project, but with gradle one copies the files into the directory libGDX generated the base project. I was coping the files into my Eclipse workspace, which is why the files were not showing up in my Eclipse project ... I know confusing huh. Well I was able to get my project to build but whenever I launched the app if crashed at runtime (see java.lang.UnsatisfiedLinkError: Native method not found: com.badlogic.gdx.backends.android.AndroidGL20.glGenTexture:()) I decided to give up on Eclipse and migrate my project to Android Studio. After taking a quick look at the Android Studio I was FINALLY able to build my app and execute it without runtime errors on my new laptop!

For clarity here is what I did to migrate my project from one laptop to another.

1) I got the my code out my git repo.

2) I downloaded the latest gdx-setup.jar, 1.5.3, from the libgdx project.

3) I generated a project, being careful to use the correct values for: Name, Package, Game class and Android SDK. For Destination I used c:\Users\Me\.

4) I copied the directories android, core, html, desktop and ios directories from my git repo into the corresponding directories in the project that gdx-setup.jar created.

5) Then I started Android Studio and follow the directions found here: Migrating to Android Studio

6) updated my build.gradle to include google play service and BANG! it worked

Community
  • 1
  • 1
Red Cricket
  • 9,762
  • 21
  • 81
  • 166
  • 1
    I found this answer here http://stackoverflow.com/questions/26085045/error-at-building-model-of-new-gradle-project-for-libgdx/26109153#26109153. – Johnathon Havens Feb 03 '15 at 05:19
  • Thank you for your response. Unfortunately following the instructions in that answer did not help me. – Red Cricket Feb 03 '15 at 05:28

1 Answers1

2

You shouldn't have to export anything, just clone the git repository on the new computer and then import gradle project and build model.

You could even generate a new libgdx project with their project wizard and then copy the source files.

  • I wish eclipse would just let me copy the source into projects source directory, but eclipse does seem to pick up on the face that there are new files. I can do the whole import thing file by file, but I have A LOT of files. Maybe it is time for me to switch to Android Studio? – Red Cricket Feb 09 '15 at 05:38
  • You must definitely can copy files like that, just click the project and press F5 (refresh). – Johnathon Havens Feb 09 '15 at 17:37