0

I have created an android project on eclipse and by default it generated the basic "Hello world!" app. With minSDK api level 8 and target api level 15 and also compiled with api 19 (latest). Everything else was set on default (blank activity etc). The problem is when I'm trying to run the app on my level 15 AVD it fails and the message "Unfortunately 'app's name' has stopped" shows up. Why is this happening? Can anyone help me fix this?

catlog

04-10 15:21:17.383: W/dalvikvm(645): VFY: unable to resolve static field 1630 (ActionBarWindow) in Landroid/support/v7/appcompat/R$styleable;
04-10 15:21:17.383: D/dalvikvm(645): VFY: replacing opcode 0x62 at 0x0004
04-10 15:21:17.392: D/AndroidRuntime(645): Shutting down VM
04-10 15:21:17.392: W/dalvikvm(645): threadid=1: thread exiting with uncaught exception (group=0x2ba041f8)
04-10 15:21:17.402: E/AndroidRuntime(645): FATAL EXCEPTION: main
04-10 15:21:17.402: E/AndroidRuntime(645): java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable
04-10 15:21:17.402: E/AndroidRuntime(645):  at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:104)
04-10 15:21:17.402: E/AndroidRuntime(645):  at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:57)
04-10 15:21:17.402: E/AndroidRuntime(645):  at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:98)
04-10 15:21:17.402: E/AndroidRuntime(645):  at com.example.asdf.MainActivity.onCreate(MainActivity.java:18)
04-10 15:21:17.402: E/AndroidRuntime(645):  at android.app.Activity.performCreate(Activity.java:4465)
04-10 15:21:17.402: E/AndroidRuntime(645):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
04-10 15:21:17.402: E/AndroidRuntime(645):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
04-10 15:21:17.402: E/AndroidRuntime(645):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
04-10 15:21:17.402: E/AndroidRuntime(645):  at android.app.ActivityThread.access$600(ActivityThread.java:123)
04-10 15:21:17.402: E/AndroidRuntime(645):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
04-10 15:21:17.402: E/AndroidRuntime(645):  at android.os.Handler.dispatchMessage(Handler.java:99)
04-10 15:21:17.402: E/AndroidRuntime(645):  at android.os.Looper.loop(Looper.java:137)
04-10 15:21:17.402: E/AndroidRuntime(645):  at android.app.ActivityThread.main(ActivityThread.java:4424)
04-10 15:21:17.402: E/AndroidRuntime(645):  at java.lang.reflect.Method.invokeNative(Native Method)
04-10 15:21:17.402: E/AndroidRuntime(645):  at java.lang.reflect.Method.invoke(Method.java:511)
04-10 15:21:17.402: E/AndroidRuntime(645):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-10 15:21:17.402: E/AndroidRuntime(645):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-10 15:21:17.402: E/AndroidRuntime(645):  at dalvik.system.NativeStart.main(Native Method)
04-10 15:21:17.692: I/dalvikvm(645): threadid=3: reacting to signal 3
04-10 15:21:17.702: I/dalvikvm(645): Wrote stack traces to '/data/anr/traces.txt'
04-10 15:21:17.943: I/dalvikvm(645): threadid=3: reacting to signal 3
04-10 15:21:17.952: I/dalvikvm(645): Wrote stack traces to '/data/anr/traces.txt'
Bryan Herbst
  • 66,602
  • 10
  • 133
  • 120
weaklin
  • 56
  • 6
  • can post your onCreate()... – vinay Maneti Apr 10 '14 at 15:38
  • 2
    _"java.lang.NoClassDefFoundError: android.support.v7.appcompat"_: Have you included the `appcompat` libraries into your project. Also, check out this [link](http://stackoverflow.com/questions/22799478/appcompat-library-for-android-how-its-linked-with-project/22799866#22799866). – ChuongPham Apr 10 '14 at 15:39
  • See this [link](http://stackoverflow.com/questions/21059612/no-resource-found-that-matches-the-given-name-style-theme-appcompat-light) and follow the steps in that answer.. – Lal Apr 10 '14 at 17:08

1 Answers1

0

Finally found a solution... I've tried to do the exact same thing as mentioned on those links and on other tutorials but could not get it fixed. Looks like eclipse was doing this automatically (including the appcompat v7 libraries and making a reference from my project to those lib). After comparing my project files with the same project files build on another environment/computer I found out that my project was missing a package in the gen folder. I fixed it by copying the package from the gen folder of the appcompat v7 project (android.support.v7.appcompat) to the gen folder of my project.

Windows 8

eclipse kepler (latest update)

sdk (latest update)

system x32

There was not such a problem on the x64 system enviroment.

weaklin
  • 56
  • 6