2

I'm stuck on an android project using libgdx.
My desktop project works perfectly.
My android project contains the libs folder containing armeabi and armeabi-v7a and the android gdx backends. Activity is declared in manifest

I'm used to using these tools. Everything used to work perfectly and all the sudden I am facing a persistent error (after project fixing, cleaning, restarting, redownloading the libs, trying different api, sdk levels, jdk...).

Here is the Log of the error

06-05 03:28:38.953: I/dalvikvm(5312): Failed resolving    
Lcom/badlogic/gdx/backends/android/AndroidApplication; interface 73 'Lcom/badlogic/gdx/Application;'
06-05 03:28:38.963: W/dalvikvm(5312): Link of class 'Lcom/badlogic/gdx/backends/android/AndroidApplication;' failed
06-05 03:28:38.963: W/dalvikvm(5312): Unable to resolve superclass of Lcom/me/example/Example_RLActivity; (94)
06-05 03:28:38.963: W/dalvikvm(5312): Link of class 'Lcom/me/example/Example_RLActivity;' failed
06-05 03:28:38.963: D/AndroidRuntime(5312): Shutting down VM
06-05 03:28:38.963: W/dalvikvm(5312): threadid=1: thread exiting with uncaught exception (group=0x409fb338)
06-05 03:28:38.963: E/AndroidRuntime(5312): FATAL EXCEPTION: main
06-05 03:28:38.963: E/AndroidRuntime(5312): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.me.example/com.me.example.Example_RLActivity}: java.lang.ClassNotFoundException: com.me.example.Example_RLActivity
06-05 03:28:38.963: E/AndroidRuntime(5312):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1880)
06-05 03:28:38.963: E/AndroidRuntime(5312):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
06-05 03:28:38.963: E/AndroidRuntime(5312):     at android.app.ActivityThread.access$600(ActivityThread.java:123)
06-05 03:28:38.963: E/AndroidRuntime(5312):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
06-05 03:28:38.963: E/AndroidRuntime(5312):     at android.os.Handler.dispatchMessage(Handler.java:99)
06-05 03:28:38.963: E/AndroidRuntime(5312):     at android.os.Looper.loop(Looper.java:137)
06-05 03:28:38.963: E/AndroidRuntime(5312):     at android.app.ActivityThread.main(ActivityThread.java:4424)
06-05 03:28:38.963: E/AndroidRuntime(5312):     at java.lang.reflect.Method.invokeNative(Native Method)
06-05 03:28:38.963: E/AndroidRuntime(5312):     at java.lang.reflect.Method.invoke(Method.java:511)
06-05 03:28:38.963: E/AndroidRuntime(5312):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
06-05 03:28:38.963: E/AndroidRuntime(5312):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)
06-05 03:28:38.963: E/AndroidRuntime(5312):     at dalvik.system.NativeStart.main(Native Method)
06-05 03:28:38.963: E/AndroidRuntime(5312): Caused by: java.lang.ClassNotFoundException: com.me.example.Example_RLActivity
06-05 03:28:38.963: E/AndroidRuntime(5312):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
06-05 03:28:38.963: E/AndroidRuntime(5312):     at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
06-05 03:28:38.963: E/AndroidRuntime(5312):     at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
06-05 03:28:38.963: E/AndroidRuntime(5312):     at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
06-05 03:28:38.963: E/AndroidRuntime(5312):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871)
06-05 03:28:38.963: E/AndroidRuntime(5312):     ... 11 more

I hope some of you might have faced the problem and solved it! Thanks in advance for your help

user1436340
  • 537
  • 1
  • 5
  • 7
  • before ask a question, search for same questions. there is several questions like it, and all of them have a same answer. – Hosein Jun 06 '12 at 09:33

4 Answers4

7

Sounds like the Android r17 upgrade bug. See the badlogic blog for the work-around: http://www.badlogicgames.com/wordpress/?p=2362

Basically, you need to explicitly tag the libGDX jar files as "exported" jars from the Android project.

P.T.
  • 24,557
  • 7
  • 64
  • 95
1

Hi I found the correct answer in the thread Testing Android project with jar dependecies just make sure to check the java project in the "Order/Export" tab of the java build-path

Community
  • 1
  • 1
magorich
  • 449
  • 5
  • 17
1

Take a look at this. I kept configuring and reconfiguring the build path but my problem was that my main project was using Java 1.7. Adjust your projects to use Java 1.6 and it should start working.

Community
  • 1
  • 1
argenkiwi
  • 2,134
  • 1
  • 23
  • 26
1

If none of the above posts is answering your question and you are using a newer libGDX, one having Gradle integration (I think starting with version 1.0.0), make sure that you have your Eclipse / ADT Gradle plugin installed like this.

It took me many hours to figure this out after an ADT... "upgrade".

Hope this helps.

JedyKnite
  • 71
  • 8