HelloWorld Crashes on 2.2

Started by Vain Pageantry, May 24, 2011, 09:06:09 PM

Previous topic - Next topic

Vain Pageantry

So I have been trying to get the hang of JPCT-AE. So I sit down to do the HelloWorld Example. When I launch it from my own interpretation of the code it crashes so I figure must be my fault. But to check I decided to Copy and Paste the code right from the wiki. It crashes .

The Console reads:
Quote

[2011-05-24 14:02:19 - HelloWorld] Android Launch!
[2011-05-24 14:02:19 - HelloWorld] adb is running normally.
[2011-05-24 14:02:19 - HelloWorld] Performing com.threed.jpct.example.helloworld activity launch
[2011-05-24 14:02:19 - HelloWorld] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'Junkbed'
[2011-05-24 14:02:19 - HelloWorld] WARNING: Application does not specify an API level requirement!
[2011-05-24 14:02:19 - HelloWorld] Device API version is 8 (Android 2.2)
[2011-05-24 14:02:24 - HelloWorld] Application already deployed. No need to reinstall.
[2011-05-24 14:02:24 - HelloWorld] Starting activity com.threed.jpct.example.helloworld on device emulator-5554
[2011-05-24 14:02:27 - HelloWorld] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.threed.jpct.example/.helloworld }

The error message  is a tipical "process com.threed.jpct.example has stopped."

Any idea what is going wrong?

EgonOlsen

Here has to be some exception in the log. Switch to DDMS inside Eclipse to see it.

Vain Pageantry

Logcat:
Quote

05-24 19:28:46.820: ERROR/AndroidRuntime(310): FATAL EXCEPTION: main
05-24 19:28:46.820: ERROR/AndroidRuntime(310): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.threed.jpct.example/com.threed.jpct.example.helloworld}: java.lang.ClassNotFoundException: com.threed.jpct.example.helloworld in loader dalvik.system.PathClassLoader[/data/app/com.threed.jpct.example-1.apk]
05-24 19:28:46.820: ERROR/AndroidRuntime(310):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
05-24 19:28:46.820: ERROR/AndroidRuntime(310):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
05-24 19:28:46.820: ERROR/AndroidRuntime(310):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
05-24 19:28:46.820: ERROR/AndroidRuntime(310):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
05-24 19:28:46.820: ERROR/AndroidRuntime(310):     at android.os.Handler.dispatchMessage(Handler.java:99)
05-24 19:28:46.820: ERROR/AndroidRuntime(310):     at android.os.Looper.loop(Looper.java:123)
05-24 19:28:46.820: ERROR/AndroidRuntime(310):     at android.app.ActivityThread.main(ActivityThread.java:4627)
05-24 19:28:46.820: ERROR/AndroidRuntime(310):     at java.lang.reflect.Method.invokeNative(Native Method)
05-24 19:28:46.820: ERROR/AndroidRuntime(310):     at java.lang.reflect.Method.invoke(Method.java:521)
05-24 19:28:46.820: ERROR/AndroidRuntime(310):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-24 19:28:46.820: ERROR/AndroidRuntime(310):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
05-24 19:28:46.820: ERROR/AndroidRuntime(310):     at dalvik.system.NativeStart.main(Native Method)
05-24 19:28:46.820: ERROR/AndroidRuntime(310): Caused by: java.lang.ClassNotFoundException: com.threed.jpct.example.helloworld in loader dalvik.system.PathClassLoader[/data/app/com.threed.jpct.example-1.apk]
05-24 19:28:46.820: ERROR/AndroidRuntime(310):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
05-24 19:28:46.820: ERROR/AndroidRuntime(310):     at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
05-24 19:28:46.820: ERROR/AndroidRuntime(310):     at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
05-24 19:28:46.820: ERROR/AndroidRuntime(310):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
05-24 19:28:46.820: ERROR/AndroidRuntime(310):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
05-24 19:28:46.820: ERROR/AndroidRuntime(310):     ... 11 more
[/qoute]

I don't know how to specifically check DDMS I will be looking that up to see what the issue is.

Vain Pageantry

Could I somehow not be invoking the JPCT-AE Library the proper way?

EgonOlsen

It says that it can't find the helloworld.class in the APK. If you've copied the source code from the wiki, the class should actually be called HelloWorld. Check your AndroidManifest.xml to see, if the correct name is in there (upper-/lowercase matters).

Vain Pageantry

Yes. That worked thank you for the timely response.