5
I installed the Android SDK all right, installed the USB drivers of my Motorola Moto G. It’s all right, so when I run the application directly from Eclipse, it finds my device connected. USB debugging is enabled.
But when I run the application, and Eclipse does the installation of . apk, my device, when opening the application, instantly displays "My App has stopped".
I’ve tried everything and I can’t make it run. I want to run on my device because it’s Android Kitkat and because AVD is slow sometimes.
logcat displays this when running the application on the device:
04-28 22:27:07.680: W/dalvikvm(13905): VFY: unable to resolve static field 1630 (ActionBarWindow) in Landroid/support/v7/appcompat/R$styleable;
04-28 22:27:07.681: D/dalvikvm(13905): VFY: replacing opcode 0x62 at 0x0004
04-28 22:27:07.682: D/AndroidRuntime(13905): Shutting down VM
04-28 22:27:07.682: W/dalvikvm(13905): threadid=1: thread exiting with uncaught exception (group=0x41ef5d40)
04-28 22:27:07.684: E/AndroidRuntime(13905): FATAL EXCEPTION: main
04-28 22:27:07.684: E/AndroidRuntime(13905): Process: com.example.myfirstapp, PID: 13905
04-28 22:27:07.684: E/AndroidRuntime(13905): java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable
04-28 22:27:07.684: E/AndroidRuntime(13905): at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:104)
04-28 22:27:07.684: E/AndroidRuntime(13905): at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:57)
04-28 22:27:07.684: E/AndroidRuntime(13905): at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:98)
04-28 22:27:07.684: E/AndroidRuntime(13905): at com.example.myfirstapp.MainActivity.onCreate(MainActivity.java:18)
04-28 22:27:07.684: E/AndroidRuntime(13905): at android.app.Activity.performCreate(Activity.java:5248)
04-28 22:27:07.684: E/AndroidRuntime(13905): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
04-28 22:27:07.684: E/AndroidRuntime(13905): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2173)
04-28 22:27:07.684: E/AndroidRuntime(13905): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2269)
04-28 22:27:07.684: E/AndroidRuntime(13905): at android.app.ActivityThread.access$800(ActivityThread.java:139)
04-28 22:27:07.684: E/AndroidRuntime(13905): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
04-28 22:27:07.684: E/AndroidRuntime(13905): at android.os.Handler.dispatchMessage(Handler.java:102)
04-28 22:27:07.684: E/AndroidRuntime(13905): at android.os.Looper.loop(Looper.java:136)
04-28 22:27:07.684: E/AndroidRuntime(13905): at android.app.ActivityThread.main(ActivityThread.java:5102)
04-28 22:27:07.684: E/AndroidRuntime(13905): at java.lang.reflect.Method.invokeNative(Native Method)
04-28 22:27:07.684: E/AndroidRuntime(13905): at java.lang.reflect.Method.invoke(Method.java:515)
04-28 22:27:07.684: E/AndroidRuntime(13905): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
04-28 22:27:07.684: E/AndroidRuntime(13905): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
04-28 22:27:07.684: E/AndroidRuntime(13905): at dalvik.system.NativeStart.main(Native Method)
And the emulator works well?
– Jorge B.
Neither, @Jorgeb.
– Andrey Luiz
From what I saw in stacktrace, it needs a jar that is referenced in Buildpath: appcompat_v7.jar. Except he’s referencing this guy and he’s not finding.
– Andrey Luiz
I solved the @Jorgeb problem. I added the following line to Androidmanifest.xml:
<library android:name="C:\dev\android\workspace\appcompat_v7\bin\appcompat_v7.jar" />
– Andrey Luiz
Create an answer with what you’ve done and in two days you can accept it.
– Jorge B.
I have. Thank you.
– Andrey Luiz