1
  • I'm extends ActionBarActivity at my MainActivity class.
  • I use Eclipse to run my project.
  • I've add android-support-v7-appcompat.jar at libs folder. then select Build Path for it.
  • I manage to see android-support-v7-appcompat.jar locate at Android Private libraries and Referenced Libraries.
  • within the gen folder,I manage to see R.java under my project package name

I 've refer to Error implementing Support Library Action Bar .However,my problem still exist.

one of the comment I notice from the link above

Are you completely sure that you have "android.support.v7.appcompat.R.java" in your gen     folder? Without it, it won't work –  Bored

My R.java is locate at org.hello.restWebService(my project package name) ,not under android.support.v7.appcompat.Does it because of this?so I get the error.

I'm experience java desktop developer but very new on android apps development.So not very clear about the idea for R.java and what should its generated contents code looks like .

Hope someone advice,thanks

03-30 23:14:49.128: E/AndroidRuntime(1205): java.lang.NoClassDefFoundError:     android.support.v7.appcompat.R$styleable
03-30 23:14:49.128: E/AndroidRuntime(1205):     at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:107)
03-30 23:14:49.128: E/AndroidRuntime(1205):     at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:58)
03-30 23:14:49.128: E/AndroidRuntime(1205):     at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:98)
03-30 23:14:49.128: E/AndroidRuntime(1205):     at org.hello.rest.MainActivity.onCreate(MainActivity.java:22)
03-30 23:14:49.128: E/AndroidRuntime(1205):     at android.app.Activity.performCreate(Activity.java:5231)
03-30 23:14:49.128: E/AndroidRuntime(1205):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
03-30 23:14:49.128: E/AndroidRuntime(1205):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
03-30 23:14:49.128: E/AndroidRuntime(1205):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
03-30 23:14:49.128: E/AndroidRuntime(1205):     at android.app.ActivityThread.access$800(ActivityThread.java:135)
03-30 23:14:49.128: E/AndroidRuntime(1205):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
03-30 23:14:49.128: E/AndroidRuntime(1205):     at android.os.Handler.dispatchMessage(Handler.java:102)
03-30 23:14:49.128: E/AndroidRuntime(1205):     at android.os.Looper.loop(Looper.java:136)
03-30 23:14:49.128: E/AndroidRuntime(1205):     at android.app.ActivityThread.main(ActivityThread.java:5017)
03-30 23:14:49.128: E/AndroidRuntime(1205):     at java.lang.reflect.Method.invokeNative(Native Method)
03-30 23:14:49.128: E/AndroidRuntime(1205):     at java.lang.reflect.Method.invoke(Method.java:515)
03-30 23:14:49.128: E/AndroidRuntime(1205):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
03-30 23:14:49.128: E/AndroidRuntime(1205):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
03-30 23:14:49.128: E/AndroidRuntime(1205):     at dalvik.system.NativeStart.main(Native Method)
Community
  • 1
  • 1
user3354708
  • 57
  • 3
  • 9
  • If all you've done is added the jar in your libs directory, then you haven't followed the instructions on how set up the support library. – ianhanniballake Mar 31 '14 at 03:54
  • no need to put library in lib folder u need to set appcompct from here check http://stackoverflow.com/questions/22573346/actionbar-in-android-maven-project-using-android-support-library-v7/22573437#22573437 – PankajAndroid Mar 31 '14 at 04:41

0 Answers0