1

I am trying to import the Eclipse project example available on the link below, however, is not working.

Can anyone explain me how to do this import correctly on the Eclipse? I found that sample here on:

Libgdx game using Google Play Game Services on iOS and Android

Link to Sample:

https://github.com/TheInvader360/libgdx-gameservices-tutorial

Community
  • 1
  • 1
user3771516
  • 173
  • 7
  • Have you tried importing the project and it failed? Or are you asking here before you even try? I'll provide one tip, do not try to import a new project into the same workspace where the project source is located... – Eric Oct 07 '15 at 12:57
  • I have tried to import, but it not worked. It does not generate error in importing (gradle project) only when I try to run desktop, for example, shows error: Selection does not contain a main type. I would like to know the correct process to import this project as it has several folders and flees rather than I'm used to using. – user3771516 Oct 07 '15 at 13:35
  • That error message is letting you know that you tried to run a class/project that does not contain a main method. Search for "main(" in the code and then try to run that class. – Eric Oct 07 '15 at 14:29
  • public class Main { public static void main(String[] args) { LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration(); cfg.title = "tutorial-libgdx-gameservices"; cfg.useGL20 = false; cfg.width = 320; cfg.height = 480; new LwjglApplication(new TutorialLibgdxGameservices(new ActionResolverDesktop()), cfg); } } – user3771516 Oct 07 '15 at 15:00
  • Exist a main method and no errors on desktop project. It must be something wrong when importing, just do not know what. You could not please download the example and see if you can import? – user3771516 Oct 07 '15 at 15:01
  • Sorry, I don't have the time to be download unknown projects and testing thing right now. Again, I would suggest looking into why it is not finding the main method. – Eric Oct 09 '15 at 13:00
  • I made some changes (based on a project that works fine), and the error of the main type disappeared. Now does not recognize the libgdx, the import declaration shows erro: "The import com.badlogic can not be resolved" And in the main class "LwjglApplicationConfiguration can not be resolved to a type". What is missing now? – user3771516 Oct 09 '15 at 14:08

1 Answers1

0

First: This is not a gradle project!

You can simply import it by (english version):

  1. Download the zip file: https://github.com/TheInvader360/libgdx-gameservices-tutorial/archive/master.zip
  2. Opening eclipse
  3. Right click on an empty space in the project explorer tab
  4. Click on "Import..."
  5. Select "General->Existing Projects into Workspace"
  6. Select the radio button "Select archive file:"
  7. Browse to the downloaded zip file and select it.
  8. Click on "Open"
  9. Under "Projects:" click on "Select All"
  10. Click on "Finish"

I was able to start the desktop project, sine I do NOT have the android SDK installed I could NOT test the other projects. Note that you need the correct version of the android SDK.

Pinkie Swirl
  • 2,375
  • 1
  • 20
  • 25
  • Do you mean the ...-android project? It was not empty for me (one class: MainActivity). If the project was already imported by one of your former tries, it was not imported again, so remove it from eclipse and import it again. Make sure your downloaded file contains the correct stuff (no empty folders etc.). Maybe you accidently deleted some stuff through eclipse. Are you refreshing the project explorer automatically? Otherwise trxy to refresh it manually. If all that is not the case, create a completely new workspace and try importing there. – Pinkie Swirl Oct 11 '15 at 15:07
  • It worked. Thanks. Just one time, on export apk, shows error: Conversion to Darvik failed with error 1. I close Eclipse, try again, and works. What this error means? – user3771516 Oct 13 '15 at 10:26