-1
04-28 14:59:14.412: E/AndroidRuntime(21823): FATAL EXCEPTION: main
04-28 14:59:14.412: E/AndroidRuntime(21823): java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable
04-28 14:59:14.412: E/AndroidRuntime(21823):    at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:107)
04-28 14:59:14.412: E/AndroidRuntime(21823):    at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:58)
04-28 14:59:14.412: E/AndroidRuntime(21823):    at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:98)
04-28 14:59:14.412: E/AndroidRuntime(21823):    at com.lociiapp.HomeActivity.onCreate(HomeActivity.java:63)
04-28 14:59:14.412: E/AndroidRuntime(21823):    at android.app.Activity.performCreate(Activity.java:5122)
04-28 14:59:14.412: E/AndroidRuntime(21823):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1150)
04-28 14:59:14.412: E/AndroidRuntime(21823):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2315)
04-28 14:59:14.412: E/AndroidRuntime(21823):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2403)
04-28 14:59:14.412: E/AndroidRuntime(21823):    at android.app.ActivityThread.access$600(ActivityThread.java:165)
04-28 14:59:14.412: E/AndroidRuntime(21823):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1373)
04-28 14:59:14.412: E/AndroidRuntime(21823):    at android.os.Handler.dispatchMessage(Handler.java:107)
04-28 14:59:14.412: E/AndroidRuntime(21823):    at android.os.Looper.loop(Looper.java:194)
04-28 14:59:14.412: E/AndroidRuntime(21823):    at android.app.ActivityThread.main(ActivityThread.java:5391)
04-28 14:59:14.412: E/AndroidRuntime(21823):    at java.lang.reflect.Method.invokeNative(Native Method)
04-28 14:59:14.412: E/AndroidRuntime(21823):    at java.lang.reflect.Method.invoke(Method.java:525)
04-28 14:59:14.412: E/AndroidRuntime(21823):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
04-28 14:59:14.412: E/AndroidRuntime(21823):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
04-28 14:59:14.412: E/AndroidRuntime(21823):    at dalvik.system.NativeStart.main(Native Method)

Here is My LogCat Error, I am Unable to run my App on the device. I don't know why its coming while i had download one app and just imported its .apk file running on the device but the Project is not running. Need help to fix this.

Kailas
  • 7,350
  • 3
  • 47
  • 63
user3562853
  • 21
  • 2
  • 9

1 Answers1

0

04-28 14:59:14.412: E/AndroidRuntime(21823): java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable

You haven't referenced AppCompat properly in your android project.

Follow Adding libraries with resources

https://developer.android.com/tools/support-library/setup.html

From the docs

To add a Support Library with resources (such as v7 appcompat for action bar) to your application project:

Using Eclipse

Create a library project based on the support library code:

  1. Make sure you have downloaded the Android Support Library using the SDK Manager. Create a library project and ensure the required JAR files are included in the project's build path: Select File > Import. Select Existing Android Code Into Workspace and click Next.

  2. Browse to the SDK installation directory and then to the Support Library folder. For example, if you are adding the appcompat project, browse to /extras/android/support/v7/appcompat/. Click Finish to import the project. For the v7 appcompat project, you should now see a new project titled android-support-v7-appcompat.

  3. In the new library project, expand the libs/ folder, right-click each .jar file and select Build Path > Add to Build Path. For example, when creating the the v7 appcompat project, add both the android-support-v4.jar and android-support-v7-appcompat.jar files to the build path.

  4. Right-click the library project folder and select Build Path > Configure Build Path. In the Order and Export tab, check the .jar files you just added to the build path, so they are available to projects that depend on this library project. For example, the appcompat project requires you to export both the android-support-v4.jar and android-support-v7-appcompat.jar files. Uncheck Android Dependencies. Click OK to complete the changes.

The docs also has steps if you are using android-studio

Raghunandan
  • 132,755
  • 26
  • 225
  • 256
  • @user3562853 pls re-do it again. The stacktrace says you haven't referenced properly. That is the only reason AFAIK – Raghunandan Apr 28 '14 at 09:40
  • please help from Morning i am stucking in this issue from morning – user3562853 Apr 28 '14 at 09:40
  • @user3562853 follow this. http://stackoverflow.com/questions/15804261/unable-to-resolve-target-android-15. Again appcompat is not referenced properly – Raghunandan Apr 28 '14 at 09:41
  • error: Error: No resource found that matches the given name (at 'theme' with value '@style/ Theme.AppCompat.Light'). Error is coming now – user3562853 Apr 28 '14 at 09:42
  • http://paste.ofcode.org/34wTGwH3cacRRgWT2FFJDX4 now this again new Logcat come ... and still not working – user3562853 Apr 28 '14 at 09:46
  • @user3562853 if you don't do it right it will not work you will end in more errors one after nanother. chekc manifest for activity declaration and packagename – Raghunandan Apr 28 '14 at 09:46
  • am Stucking this issue from morning can i have ur email id so that u can check and my project and revert me back for changes? – user3562853 Apr 28 '14 at 09:46
  • i have check all the thing and even i install all SDk version then also its not working am telling truth see this i have post this Question morning also – user3562853 Apr 28 '14 at 09:48
  • http://stackoverflow.com/questions/23333190/unable-to-run-android-project-on-device-and-emulator/23333302?noredirect=1#23333302 – user3562853 Apr 28 '14 at 09:49
  • Good Luck. Refer `AppCompat`. extend `ActionBarActivity` use `Theme.AppCompat`. It will work. – Raghunandan Apr 28 '14 at 09:51
  • post the way you referenced `AppCompat` – Raghunandan Apr 28 '14 at 09:54
  • this is Style value folder and then i add it in manifiest file – user3562853 Apr 28 '14 at 09:57
  • @Raghunadan yaar plz help – user3562853 Apr 28 '14 at 10:04
  • @user3562853 right click on your project. goto properties. Goto android and check if you have appcompat referenced. That manifest looks fine – Raghunandan Apr 28 '14 at 11:44
  • yes i have when i Run in that way Then App Becomes crash and another lOgCat comes – user3562853 Apr 28 '14 at 11:54
  • @user3562853 the log you posted is clear that you haven't referenced appcompat properly. This leading to a discussion and you don't have enough repo tot chat. Refer appcompat and you are good to go – Raghunandan Apr 28 '14 at 11:56
  • i am telling u its another type of Error is there can u tell ur email id so that i can send my dummyExample – user3562853 Apr 28 '14 at 11:56