1

I am using IntelliJ and my project has appcompat (C:\Android\android-sdk\extras\android\support\v7\appcompat) as a dependency, the appcompat has android-support-v4.jar and android-support-v7-appcompat.jar. In my main project i didn't import/include both the android-support-v4.jar and android-support-v7-appcompat.jar

The problem is that everytime i run my app i am getting the following error:

java.lang.NoClassDefFoundError: android.support.v7.app.AppCompatDelegateImplV14
        at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:93)
    at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:77)
    at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:429)
    at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:57)
    at com.******.*****.MainActivity.onCreate(MainActivity.java:48)

I have tried almost all the answers on Stack Overflow but with no luck. Do anyone know where i am going wrong?

Project Structure 1 Project Structure 2 Project Structure 3 Project Structure 4

ckesc
  • 511
  • 4
  • 16
Tamu_Munya
  • 25
  • 1
  • 9
  • Are you using IntelliJ's build system, ant, or gradle? – Sky Kelsey Aug 05 '15 at 00:06
  • post your build.gradle – IntelliJ Amiya Aug 05 '15 at 05:43
  • @Jared, no. IntelliJ can build Android projects natively using its own build system, or it can use Gradle, or it can use Ant. – Sky Kelsey Aug 05 '15 at 19:03
  • 1
    I do not know where my comment went but Intellij(he is most likely using Android Studio) does use Gradle. That is what I saying. – Jared Burrows Aug 05 '15 at 19:10
  • Sure, but I deduced he wasn't using Gradle from these clues: One, he mentions the absolute path to the library. He wouldn't do this if he was using Gradle. Two, in a comment to the answer below, he says he isn't using Gradle. – Sky Kelsey Aug 06 '15 at 05:37
  • @SkyKelsey, i have added image links of my project structure, maybe this might give a good understanding of my problem. Thank you for your responses :) – Tamu_Munya Aug 07 '15 at 10:56

1 Answers1

1
java.lang.NoClassDefFoundError: android.support.v7.app.AppCompatDelegateImplV14

NoClassDefFoundError indicates that the classloader, which is responsible for dynamically loading classes, cannot find the .class.

Please add this in your build.gradle

compile 'com.android.support:appcompat-v7:22.2.0' 
IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198
  • My project is not gradle built, i tried the following http://stackoverflow.com/questions/18025942/how-do-i-add-a-library-android-support-v7-appcompat-in-intellij-idea and http://stackoverflow.com/questions/27164539/exception-java-lang-noclassdeffounderror-android-support-v7-appcompat-rstyleab?rq=1 but no luck. Please assist – Tamu_Munya Aug 05 '15 at 13:32
  • 1
    You need to tell us how you are building your project, otherwise we can't advise you on how to fix the error. See my comment on your question. – Sky Kelsey Aug 05 '15 at 19:05
  • 1
    @SkyKelsey i have edited my question by including the screenshots of my project structure – Tamu_Munya Aug 07 '15 at 17:31