Slick Forums

Discuss the Slick 2D Library
It is currently Sun Jul 21, 2019 9:05 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed Aug 28, 2013 5:43 am 
Offline

Joined: Sun Feb 24, 2013 5:14 am
Posts: 4
I'm another one of those guys, who has been programming simple desktop games in java for years, but whose use of Android type tools never works right because the build path is never quite right.
Anyway, so here's my trouble:
I wanted to port a rather complicated Slick2D game to Android, or try. I haven't done much with Android, but I've done a little bit of learning. I tried both the Slick-Android-Test project provided at https://bitbucket.org/kevglass/slick/downloads as well as writing my own test project by following the "Intro to Slick AE" tutorial here on this site.

I've had no luck. Nothing works; they all give the same error: a java.lang.ClassNotFoundException: Didn't find class "<name of the only Activity class in the program - the one that extends SlickActivity>" regardless of which project I was working on. Always that same error, so far as I could tell from LogCat.

Code:
08-28 05:14:59.152: E/AndroidRuntime(2964): FATAL EXCEPTION: main
08-28 05:14:59.152: E/AndroidRuntime(2964): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.newdawn.slick.android/org.newdawn.slick.android.SlickTestActivity}: java.lang.ClassNotFoundException: Didn't find class "org.newdawn.slick.android.SlickTestActivity" on path: /data/app/org.newdawn.slick.android-2.apk
08-28 05:14:59.152: E/AndroidRuntime(2964):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2106)
08-28 05:14:59.152: E/AndroidRuntime(2964):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
08-28 05:14:59.152: E/AndroidRuntime(2964):    at android.app.ActivityThread.access$600(ActivityThread.java:141)
08-28 05:14:59.152: E/AndroidRuntime(2964):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
08-28 05:14:59.152: E/AndroidRuntime(2964):    at android.os.Handler.dispatchMessage(Handler.java:99)
08-28 05:14:59.152: E/AndroidRuntime(2964):    at android.os.Looper.loop(Looper.java:137)
08-28 05:14:59.152: E/AndroidRuntime(2964):    at android.app.ActivityThread.main(ActivityThread.java:5041)
08-28 05:14:59.152: E/AndroidRuntime(2964):    at java.lang.reflect.Method.invokeNative(Native Method)
08-28 05:14:59.152: E/AndroidRuntime(2964):    at java.lang.reflect.Method.invoke(Method.java:511)
08-28 05:14:59.152: E/AndroidRuntime(2964):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
08-28 05:14:59.152: E/AndroidRuntime(2964):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
08-28 05:14:59.152: E/AndroidRuntime(2964):    at dalvik.system.NativeStart.main(Native Method)
08-28 05:14:59.152: E/AndroidRuntime(2964): Caused by: java.lang.ClassNotFoundException: Didn't find class "org.newdawn.slick.android.SlickTestActivity" on path: /data/app/org.newdawn.slick.android-2.apk
08-28 05:14:59.152: E/AndroidRuntime(2964):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
08-28 05:14:59.152: E/AndroidRuntime(2964):    at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
08-28 05:14:59.152: E/AndroidRuntime(2964):    at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
08-28 05:14:59.152: E/AndroidRuntime(2964):    at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
08-28 05:14:59.152: E/AndroidRuntime(2964):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
08-28 05:14:59.152: E/AndroidRuntime(2964):    ... 11 more


In normal JAVA programming, when I do something wrong and there is a code error, I think about that error and then fix it based upon what went wrong -- where I had a wrong step of logic or something. I cannot fix the fact that "all of the Android main activity classes I have made to be used by Slick AE cannot be found."
So it's late, and I'm tired, and I was hoping to get this working. I apologize if I seem irritable. But, I even saw somebody here on this forum who said "Hey, look, the new ADT causes ClassNotFoundExceptions on everything unless you fix it by doing X".
I did what he said, and still have the same problem. How do I make eclipse compile a Slick AE simplest of simple games (let's say... draw one image to the screen, maybe?) in a way that will actually appear on an Android device or emulator (I have both available, but have been working mostly with emulators because my device is borrowed).

How can the central activity classes of the Android app in question not be found?
All help is well appreciated! :D

Edit: Anyone who can get me something other than "The app you tried to make, unfortunately, has stopped" on any emulator or real device deserves a digital hug.


Top
 Profile  
 
PostPosted: Wed Aug 28, 2013 6:42 pm 
Offline

Joined: Sun Feb 24, 2013 5:14 am
Posts: 4
Sorry to double post, but I got the Slick-Android-Test program to start for a split second. That doesn't mean my troubles are all fixed, because it did immediately crash, but I got something on the screen, which was awesome.
Here's what I changed, for anyone else with similar problems:
• I downloaded a newer slick-ae.jar from a Kenkron upload instead of a kevglass one: https://github.com/Kenkron/Slick-AE
• As Eclipse was complaining to me about it, I moved the <uses-sdk> tag in AndroidManifest.xml to be above <application>
• Also due to an Eclipse complaint, I added android:targetSdkVersion="4" inside of the <uses-sdk> tag

Now, the new error that I've got is that:
Code:
08-28 18:31:58.504: E/AndroidRuntime(4513): FATAL EXCEPTION: GLThread 133
08-28 18:31:58.504: E/AndroidRuntime(4513): java.lang.AbstractMethodError: abstract method not implemented
08-28 18:31:58.504: E/AndroidRuntime(4513):    at org.newdawn.slick.Input.touchDown(Input.java)
08-28 18:31:58.504: E/AndroidRuntime(4513):    at com.badlogic.gdx.backends.android.AndroidInput.processEvents(Unknown Source)
08-28 18:31:58.504: E/AndroidRuntime(4513):    at com.badlogic.gdx.backends.android.AndroidGraphics.onDrawFrame(Unknown Source)
08-28 18:31:58.504: E/AndroidRuntime(4513):    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1516)
08-28 18:31:58.504: E/AndroidRuntime(4513):    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)


So, I don't know what that means went wrong (Slick-AE ought to be written such that it implements all of its own abstract methods, no? Is this secretly a build path error still?), but I'm happy that I finally got something onto the android screen!!! I saw the Slick-Android-Test game's main menu screen! (The above error occurred when I pushed the start game button onscreen.)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group