1

i had no project in eclipse, and i just followed the steps in this toturial: https://www.youtube.com/watch?v=S9fs1PVTyUc&src_vid=6i78aqugqds&feature=iv&annotation_id=annotation_4141831685

and it opened for me a few projects named: project, project-android, project-core, project-desktop, project-ios.

and the project-android had an error. here is the code:

package com.ak01.projext.android;*

import android.os.Bundle;**

import com.badlogic.gdx.backends.android.AndroidApplication;
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
import com.ak01.projext.Projec;

public class AndroidLauncher extends AndroidApplication {***
    @Override
    protected void onCreate (Bundle savedInstanceState) {****
        super.onCreate(savedInstanceState);
        AndroidApplicationConfiguration config = new 
        AndroidApplicationConfiguration();
        initialize(new Project(), config);
    }
}

but it has a few errors although i didn't touch it yet(the number of *'s matches to the line)

*The type android.os.Handler cannot be resolved. It is indirectly referenced from required .class files

**The import android.os.Bundle cannot be resolved

***Multiple markers at this line

-The type android.app.Activity cannot be resolved. It is indirectly referenced from required .class files

-The hierarchy of the type AndroidLauncher is inconsistent

****Bundle cannot be resolved to a type

Alon Kagan
  • 69
  • 9
  • That looks like an Android project which would need the Android Development Tools to be installed in Eclipse. – greg-449 Feb 02 '15 at 18:01
  • so what tools should i download? and is there a way to not use the SDK and directly use my phone? if there is then how? – Alon Kagan Feb 02 '15 at 18:40
  • You are probably missing the Android Developer Tools plugin for your Eclipse installation: http://stackoverflow.com/a/24437737/2413303 – EpicPandaForce Feb 03 '15 at 16:04
  • What do you mean by directly use your phone? You can't build an Android app without the Android SDK and Developer Tools. – Tenfour04 Feb 04 '15 at 14:02
  • 1
    In my case, i already installed adt and sdk. Same as your problem, i solved it with checking the eclipse checkbox in libgdx setup. Libgdx project setup -> advanced -> check eclipse. – Tuss Dec 18 '15 at 14:23

2 Answers2

0

It looks like you have not installed the Android developer tools. To test this, right click your project and press build path. On the side there should be an 'Android' tab, if there isn't you need the android plugin for eclipse.

dan14941
  • 332
  • 3
  • 16
0

You can try to use the advanced option to check eclipse as @Tuss said in a comment. Also note that you need the version 19 of Android SDK (it isn't valid the last version at the time of writing this, API 23).

When creating the Libgdx project:

  1. In Libgdx Project Generator open Advanced options.
  2. Check Eclipse.
  3. Generate your project.

Image with steps marked in blue

In Eclipse:

  1. Open Android SDK Manager: Window -> Android SDK Manager.
  2. Mark if it isn't installed the SDK Plataform for Android 4.4.2 (API 19) and install it. Image of the dialog to check in Android SKD 19 is installed
  3. Finally import the projects with File -> Import -> General -> Existing Projects into Workspace.
PhoneixS
  • 10,574
  • 6
  • 57
  • 73