0

Before adding Parse-1.9.4.jar to my Android Studio project everything work fine. But after adding it I got this error:

E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: funride.android.com.rideshare, PID: 14101
java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$attr
        at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(AppCompatDelegateImplV7.java:289)
        at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:246)
        at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:106)
        at funride.android.com.rideshare.parse.ParseActivity.onCreate(ParseActivity.java:18)
        at android.app.Activity.performCreate(Activity.java:5231)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
        at android.app.ActivityThread.access$800(ActivityThread.java:135)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:136)
        at android.app.ActivityThread.main(ActivityThread.java:5001)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:515)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
        at dalvik.system.NativeStart.main(Native Method)

Things that I have tried:

  1. Put Parse-1.9.4.jar into libs directory, add compile fileTree(dir: 'libs', include: ['*.jar']) in dependencies
  2. Do gradlew clean and rebuild the project
  3. Also I have added bolts-android-1.2.0.jar to the project

Hope you guys could help, I have spent hours on this problem.

Rain Vu
  • 11
  • 1
  • 3
  • Have you installed the support library? See this http://stackoverflow.com/questions/22271759/fixing-error-in-styles-xml-to-generate-r-java-no-resource-found-name-theme-ap/22271850#22271850 and here https://developer.android.com/tools/support-library/setup.html – Andrew Fielden Jul 27 '15 at 10:09
  • @AndrewFielden Yes I have installed and update my support library. I am using 'com.android.support:appcompat-v7:22.2.1'. Everything works fine until I add "Parse-1.9.4.jar" to my project. If I remove the jar, everything works ok. – Rain Vu Jul 27 '15 at 10:18

1 Answers1

0

i also got the same error while adding parse 1.9.4 in android studio.. but i'll fix issue by adding the below dependency

dependencies {

        compile fileTree(include: ['*.jar'], dir: 'libs')
        compile 'com.android.support:support-v4:21.0.3'   
        compile  files('libs/Parse-1.9.2.jar')
        compile  files('libs/bolts-android-1.2.0.jar')
        compile  files('libs/bolts-android-1.2.0-javadoc.jar')
        compile 'com.android.support:appcompat-v7:22.2.0'
  }
Sagar Limbani
  • 105
  • 1
  • 13