APP won't open

1,214 views
Skip to first unread message

Michael Leonard

unread,
Mar 31, 2012, 10:51:15 AM3/31/12
to phon...@googlegroups.com
Hello All,

 My very basic app made with Phonegap 1.5.0 and Eclipse (Latest Version)  info will not open. I get the error:  "Unfortunately (the app) has stopped."  If anyone has a clue as to what the problem is I would very much appreciate it. I tried this app on a MAC and PC with the same error message.  The "LogCat"  and "Console" follow:


03-31 09:42:41.706: D/dalvikvm(622): Not late-enabling CheckJNI (already on)
03-31 09:42:41.997: I/dalvikvm(622): Turning on JNI app bug workarounds for target SDK version 12...
03-31 09:42:42.867: W/dalvikvm(622): Unable to resolve superclass of Lorg/street/testing/TestingActivity; (14)
03-31 09:42:42.877: W/dalvikvm(622): Link of class 'Lorg/street/testing/TestingActivity;' failed
03-31 09:42:42.877: D/AndroidRuntime(622): Shutting down VM
03-31 09:42:42.877: W/dalvikvm(622): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
03-31 09:42:42.927: E/AndroidRuntime(622): FATAL EXCEPTION: main
03-31 09:42:42.927: E/AndroidRuntime(622): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.street.testing/org.street.testing.TestingActivity}: java.lang.ClassNotFoundException: org.street.testing.TestingActivity
03-31 09:42:42.927: E/AndroidRuntime(622): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1880)
03-31 09:42:42.927: E/AndroidRuntime(622): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
03-31 09:42:42.927: E/AndroidRuntime(622): at android.app.ActivityThread.access$600(ActivityThread.java:123)
03-31 09:42:42.927: E/AndroidRuntime(622): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
03-31 09:42:42.927: E/AndroidRuntime(622): at android.os.Handler.dispatchMessage(Handler.java:99)
03-31 09:42:42.927: E/AndroidRuntime(622): at android.os.Looper.loop(Looper.java:137)
03-31 09:42:42.927: E/AndroidRuntime(622): at android.app.ActivityThread.main(ActivityThread.java:4424)
03-31 09:42:42.927: E/AndroidRuntime(622): at java.lang.reflect.Method.invokeNative(Native Method)
03-31 09:42:42.927: E/AndroidRuntime(622): at java.lang.reflect.Method.invoke(Method.java:511)
03-31 09:42:42.927: E/AndroidRuntime(622): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
03-31 09:42:42.927: E/AndroidRuntime(622): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
03-31 09:42:42.927: E/AndroidRuntime(622): at dalvik.system.NativeStart.main(Native Method)
03-31 09:42:42.927: E/AndroidRuntime(622): Caused by: java.lang.ClassNotFoundException: org.street.testing.TestingActivity
03-31 09:42:42.927: E/AndroidRuntime(622): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
03-31 09:42:42.927: E/AndroidRuntime(622): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
03-31 09:42:42.927: E/AndroidRuntime(622): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
03-31 09:42:42.927: E/AndroidRuntime(622): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
03-31 09:42:42.927: E/AndroidRuntime(622): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871)
03-31 09:42:42.927: E/AndroidRuntime(622): ... 11 more
03-31 09:42:49.747: I/Process(622): Sending signal. PID: 622 SIG: 9


The Console info follows:


[2012-03-31 09:41:19 - testing] adb is running normally.
[2012-03-31 09:41:19 - testing] Performing org.street.testing.TestingActivity activity launch
[2012-03-31 09:41:19 - testing] Automatic Target Mode: launching new emulator with compatible AVD 'DW_AVD2'
[2012-03-31 09:41:19 - testing] Launching a new emulator with Virtual Device 'DW_AVD2'
[2012-03-31 09:41:21 - Emulator] 2012-03-31 09:41:21.280 emulator-arm[4456:1107] Warning once: This application, or a library it uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz.
[2012-03-31 09:41:21 - Emulator] emulator: emulator window was out of view and was recentered
[2012-03-31 09:41:21 - Emulator] 
[2012-03-31 09:41:21 - testing] New emulator found: emulator-5554
[2012-03-31 09:41:21 - testing] Waiting for HOME ('android.process.acore') to be launched...
[2012-03-31 09:42:02 - testing] HOME is up on device 'emulator-5554'
[2012-03-31 09:42:02 - testing] Uploading testing.apk onto device 'emulator-5554'
[2012-03-31 09:42:02 - testing] Installing testing.apk...
[2012-03-31 09:42:40 - testing] Success!
[2012-03-31 09:42:40 - testing] Starting activity org.street.testing.TestingActivity on device emulator-5554
[2012-03-31 09:42:41 - testing] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=org.street.testing/.TestingActivity }

JW

unread,
Mar 31, 2012, 12:24:40 PM3/31/12
to phon...@googlegroups.com
I have exactly the same problem: Followed the most basic "Getting Started" Guide from the Phonegap Page for Android.
I double-checked every step and i am positive i have done everything as expected. Still app won't launch, with a ClassNotFoundException for the main activity class.
Whats interesting is if i undo the changes for phonegap to the main activity (that is, change the inheritance from DroidGap back to Activity and remove the super.loadUrl line) the app launches without further errors.
Whats more, up until now i had a project that worked beautifully with PhoneGap. Somewhere i ran an update from the Android SDK Manager, installed some APIs, updated some Tools etc. and also updated the ADT Plugin for eclipse in the process. Could this be the source of our Problem?
@mikeleon: searching through android support forums, the Exception usually is due to a misconfigured AndroidManifest, where the android:name property of the <activity> tag does not match your main activity class. If you're sure you have this right (from what i can see from your logs, this should be android:name=".TestingActivity"), it looks like we truly have the same problem...
Can anyone else reproduce this problem relating to an update of the Android SDK?

Larry Trutter

unread,
Apr 1, 2012, 11:12:00 AM4/1/12
to phon...@googlegroups.com
I also have this same issue. It would be nice to have a solution. :-(

Michael Leonard

unread,
Apr 1, 2012, 1:41:13 PM4/1/12
to phon...@googlegroups.com, ltru...@gmail.com, jakob.jw.weiss
Hello Larry and JW,

Hopefully, we will get this figured out soon. I have that same problem weather on a PC or MacBook Air. If I come up with a solution I will pass it along to you guys.

Mike L






--
You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com

Simon MacDonald

unread,
Apr 5, 2012, 7:06:26 AM4/5/12
to phon...@googlegroups.com
Hey all,

I'm not 100% sure why the R17 tools would be causing problems. As I
mentioned before I ran into a bug where my libs directory had multiple
versions of phonegap.jar in it which caused multiple copies of the
same class to be loaded which, of course, is a no no.

Anyway, I create a small test project that people who are having
problems with can import into Eclipse. This is using the PhoneGap
1.5.0 download so it should be the same as what everyone else has.
Give it a try:

http://dl.dropbox.com/u/887989/TestR17.zip

Simon Mac Donald
http://hi.im/simonmacdonald

JW

unread,
Apr 5, 2012, 8:35:02 PM4/5/12
to phon...@googlegroups.com
Hello Simon,

Your example project works just fine, thanks! Did you do anything special or did you just start a new project like the getting started and replace your own index.html?
Will compare the differences to my projects later and see if i can figure out whats the problem. But since i am no native Android wizard, this might not yield any surprising insights ;-) Any suggestions as to what went wrong would be really helpful, because obviously i am far from the only one having this error popping up..

Regards
Jacob W

Michael Leonard

unread,
Apr 5, 2012, 9:13:57 PM4/5/12
to phon...@googlegroups.com
Simon,

I tried your TestR17.zip and it worked very well. Then I set up my simple app exactly the same as yours except for the name of the app. (AndroidManifest and (name.java) file (See Below). The blasted thing will not load. The LogCat and Consul follow. Can you shed some light on what the problem might be?

Mike L

Activity.Java
package org.sports.golf;

import org.apache.cordova.*;

import android.os.Bundle;

public class GolfActivity extends DroidGap {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.loadUrl("file:///android_asset/www/index.html");
    }
}


AndroidManifest.xml


<?xml version="1.0" encoding="utf-8"?>
    package="org.sports.golf"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="7" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.RECEIVE_SMS" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.RECORD_VIDEO"/>
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.WRITE_CONTACTS" />   
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />   
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.BROADCAST_STICKY" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />

    

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        android:configChanges="orientation|keyboardHidden|screenSize">

       

        <activity
            android:name=".GolfActivity"
            android:label="@string/app_name" >

           

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

LogCat

04-05 19:55:23.042: D/ddm-heap(239): Got feature list request
04-05 19:55:23.312: W/dalvikvm(239): Unable to resolve superclass of Lorg/sports/golf/GolfActivity; (14)
04-05 19:55:23.312: W/dalvikvm(239): Link of class 'Lorg/sports/golf/GolfActivity;' failed
04-05 19:55:23.342: D/AndroidRuntime(239): Shutting down VM
04-05 19:55:23.342: W/dalvikvm(239): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
04-05 19:55:23.351: E/AndroidRuntime(239): Uncaught handler: thread main exiting due to uncaught exception
04-05 19:55:23.382: E/AndroidRuntime(239): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.sports.golf/org.sports.golf.GolfActivity}: java.lang.ClassNotFoundException: org.sports.golf.GolfActivity in loader dalvik.system.PathClassLoader@44da27e8
04-05 19:55:23.382: E/AndroidRuntime(239): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)
04-05 19:55:23.382: E/AndroidRuntime(239): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
04-05 19:55:23.382: E/AndroidRuntime(239): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
04-05 19:55:23.382: E/AndroidRuntime(239): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
04-05 19:55:23.382: E/AndroidRuntime(239): at android.os.Handler.dispatchMessage(Handler.java:99)
04-05 19:55:23.382: E/AndroidRuntime(239): at android.os.Looper.loop(Looper.java:123)
04-05 19:55:23.382: E/AndroidRuntime(239): at android.app.ActivityThread.main(ActivityThread.java:4363)
04-05 19:55:23.382: E/AndroidRuntime(239): at java.lang.reflect.Method.invokeNative(Native Method)
04-05 19:55:23.382: E/AndroidRuntime(239): at java.lang.reflect.Method.invoke(Method.java:521)
04-05 19:55:23.382: E/AndroidRuntime(239): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
04-05 19:55:23.382: E/AndroidRuntime(239): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
04-05 19:55:23.382: E/AndroidRuntime(239): at dalvik.system.NativeStart.main(Native Method)
04-05 19:55:23.382: E/AndroidRuntime(239): Caused by: java.lang.ClassNotFoundException: org.sports.golf.GolfActivity in loader dalvik.system.PathClassLoader@44da27e8
04-05 19:55:23.382: E/AndroidRuntime(239): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
04-05 19:55:23.382: E/AndroidRuntime(239): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
04-05 19:55:23.382: E/AndroidRuntime(239): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
04-05 19:55:23.382: E/AndroidRuntime(239): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
04-05 19:55:23.382: E/AndroidRuntime(239): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409)
04-05 19:55:23.382: E/AndroidRuntime(239): ... 11 more
04-05 19:55:23.432: I/dalvikvm(239): threadid=7: reacting to signal 3
04-05 19:55:23.432: E/dalvikvm(239): Unable to open stack trace file '/data/anr/traces.txt': Permission denied



Console:
2012-04-05 19:44:48 - Emulator] 2012-04-05 19:44:48.684 emulator-arm[8309:1107] Warning once: This application, or a library it uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz.
[2012-04-05 19:44:48 - Golf] New emulator found: emulator-5554
[2012-04-05 19:44:48 - Golf] Waiting for HOME ('android.process.acore') to be launched...
[2012-04-05 19:45:09 - Golf] HOME is up on device 'emulator-5554'
[2012-04-05 19:45:09 - Golf] Uploading Golf.apk onto device 'emulator-5554'
[2012-04-05 19:45:09 - Golf] Installing Golf.apk...
[2012-04-05 19:45:19 - Golf] Success!
[2012-04-05 19:45:19 - Golf] Starting activity org.sports.golf.GolfActivity on device emulator-5554
[2012-04-05 19:45:23 - Golf] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=org.sports.golf/.GolfActivity }
[2012-04-05 19:54:04 - TestR17] Android requires compiler compliance level 5.0 or 6.0. Found '1.4' instead. Please use Android Tools > Fix Project Properties.
[2012-04-05 19:54:38 - Golf] ------------------------------
[2012-04-05 19:54:38 - Golf] Android Launch!
[2012-04-05 19:54:38 - Golf] adb is running normally.
[2012-04-05 19:54:38 - Golf] Performing org.sports.golf.GolfActivity activity launch
[2012-04-05 19:54:38 - Golf] Automatic Target Mode: launching new emulator with compatible AVD 'DroidX'
[2012-04-05 19:54:38 - Golf] Launching a new emulator with Virtual Device 'DroidX'
[2012-04-05 19:54:40 - Emulator] 2012-04-05 19:54:40.035 emulator-arm[8327:1107] Warning once: This application, or a library it uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz.
[2012-04-05 19:54:40 - Golf] New emulator found: emulator-5554
[2012-04-05 19:54:40 - Golf] Waiting for HOME ('android.process.acore') to be launched...
[2012-04-05 19:55:11 - Golf] HOME is up on device 'emulator-5554'
[2012-04-05 19:55:11 - Golf] Uploading Golf.apk onto device 'emulator-5554'
[2012-04-05 19:55:11 - Golf] Installing Golf.apk...
[2012-04-05 19:55:20 - Golf] Success!
[2012-04-05 19:55:20 - Golf] Starting activity org.sports.golf.GolfActivity on device emulator-5554
[2012-04-05 19:55:22 - Golf] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=org.sports.golf/.GolfActivity }

Michael Leonard

unread,
Apr 5, 2012, 9:29:48 PM4/5/12
to phon...@googlegroups.com

Simon MacDonald

unread,
Apr 9, 2012, 10:59:53 AM4/9/12
to phon...@googlegroups.com
No, I just create a new Android project from scratch.

Simon MacDonald

unread,
Apr 9, 2012, 11:01:55 AM4/9/12
to phon...@googlegroups.com
You may want to try creating a new project from scratch like I did. Also, check out:


Simon Mac Donald
http://hi.im/simonmacdonald


Saulo Aguiar

unread,
Apr 10, 2012, 10:42:36 PM4/10/12
to phonegap
hey guys,

I was facing the same problem but I realized that I forgot to add the
"android:configChanges="orientation|keyboardHidden" to the application
node inside the AndroidManifest.xml file. The activities that I use in
the project have this atribute too.

good luck :)

On Apr 9, 12:01 pm, Simon MacDonald <simon.macdon...@gmail.com> wrote:
> You may want to try creating a new project from scratch like I did. Also,
> check out:
>
> http://android.foxykeep.com/dev/how-to-fix-the-classdefnotfounderror-...
>
> Simon Mac Donaldhttp://hi.im/simonmacdonald
>
> On Thu, Apr 5, 2012 at 9:13 PM, Michael Leonard <m...@streetdrugs.org>wrote:
>
>
>
>
>
>
>
> > Simon,
>
> > I tried your TestR17.zip and it worked very well. Then I set up my simple
> > app exactly the same as yours except for the name of the app.
> > (AndroidManifest and (name.java) file (See Below). The blasted thing will
> > not load. The LogCat and Consul follow. Can you shed some light on what the
> > problem might be?
>
> > Mike L
>
> > *Activity.Java*
> > *
> > *
> > *LogCat*
> > *Console:*
> > *
> > *
>
> > On Apr 5, 2012, at 7:35 PM, JW wrote:
>
> > Hello Simon,
>
> > Your example project works just fine, thanks! Did you do anything special
> > or did you just start a new project like the getting started and replace
> > your own index.html?
> > Will compare the differences to my projects later and see if i can figure
> > out whats the problem. But since i am no native Android wizard, this might
> > not yield any surprising insights ;-) Any suggestions as to what went wrong
> > would be really helpful, because obviously i am far from the only one
> > having this error popping up..
>
> > Regards
> > Jacob W
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "phonegap" group.
> > To post to this group, send email to phon...@googlegroups.com
> > To unsubscribe from this group, send email to
> > phonegap+u...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/phonegap?hl=en?hl=en
>
> > For more info on PhoneGap or to download the code go towww.phonegap.com
>
> >  --
> > You received this message because you are subscribed to the Google
> > Groups
>
> ...
>
> read more »

JW

unread,
Apr 12, 2012, 7:40:27 PM4/12/12
to phon...@googlegroups.com
I followed the Instructions from the guy over at FoxyKeep and it worked!
So here the short fix for this:
1. Remove all libraries you manually added to the build path (Project Properties->Java Build Path->Libraries-> remove everything except Android 2.2 and Androi Dependencies)
2. rename the 'lib' folder (where cordova.jar is) to 'libs'
3. hooray :)
again, this is from  here: http://android.foxykeep.com/dev/how-to-fix-the-classdefnotfounderror-with-adt-17
just replicating it to make it easier to find, not taking credits for this!

Unk

unread,
May 23, 2012, 3:17:42 PM5/23/12
to phonegap
I was with the same problem... make sure if you put the "xml" folder
of cordova download.. in your "res" project folder =)

good luck !

On 13 abr, 03:40, JW <jakob.jw.we...@googlemail.com> wrote:
> I followed the Instructions from the guy over at FoxyKeep and it worked!
> So here the short fix for this:
> 1. Remove all libraries you manually added to the build path (Project
> Properties->Java Build Path->Libraries-> remove everything except Android
> 2.2 and Androi Dependencies)
> 2. rename the 'lib' folder (where cordova.jar is) to 'libs'
> 3. hooray :)
> again, this is from  here:http://android.foxykeep.com/dev/how-to-fix-the-classdefnotfounderror-...
Reply all
Reply to author
Forward
0 new messages