1

I have originally created my large project using Eclipse after android studio stable version came i migrated AS(Android studio).Currently Android studio is building for android 5.1 Nexus Tab 10 as well as 7 .but getting error after running on only samsung android 4.2.2.

appcompat-v7 v21.0.0 causing crash on Samsung devices with Android v4.2.2

i have tried above solution but problem is i don't have default proguard file as i have migrated from AS TO Eclipse .AS didn't generete proguard file.

then i did some research and created an app in eclipse and imported into Android Studio and it worked without using proguard .so my question what is happing AS is having problem or Samsung 4.2.2 with AppCompact. i got following error for samsung 4.2.2.plz guide me .thanks in advance

java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$layout at android.support.v7.app.ActionBarActivityDelegateBase.ensureSubDecor(ActionBarActivityDelegateBase.java:297) at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:225) at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102) at com.generaldevelopers.smartserve.activities.MainActicity.onCreate(MainActicity.java:41) at android.app.Activity.performCreate(Activity.java:5326) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1097) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2218) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2309) at android.app.ActivityThread.access$700(ActivityThread.java:157) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1289) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:176) at android.app.ActivityThread.main(ActivityThread.java:5319) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869) at dalvik.system.NativeStart.main(Native Method)

Community
  • 1
  • 1
AKASH WANGALWAR
  • 1,326
  • 1
  • 14
  • 21

2 Answers2

1

The problem here could be one the following

  1. Your sdk might not have appcompact_v7 library installed if not try installing it by opening sdk manager.
  2. You are using older version of compact and your project requires new version.
  3. You have not mentioned appcompact_v7 correctly in your project Gradle file.
dependencies {
    compile 'com.android.support:appcompat-v7:21.0.+
}

specify appcompact_v7 path like this in your Gradle file

Try installing the latest appcompact V7 library and cleaning your project.

Ankit Khare
  • 1,345
  • 11
  • 30
  • i have provided like this compile 'com.android.support:appcompat-v7:22.1.1' i have appcompact library installed in sdk the latest one .i am using 22.1.1 as mentioned above and i have mentioned correctly . i am able to run on other devices apart from samsung 4.2.2 – AKASH WANGALWAR May 07 '15 at 04:13
1

i have solved this by just

  1. Adding appcompat v7 as a library project to Android Studio.
  2. Adding this line: configurations { all*.exclude group: 'com.android.support', module: 'support-v4' } to my app Gradle after depedency section.
  3. Adding MultiDex.install(this); in my Application class to resolve multidex issues.
AKASH WANGALWAR
  • 1,326
  • 1
  • 14
  • 21