简体   繁体   中英

android.support.v7.app.AppCompatDelegateImplV14

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?

项目结构1项目结构2项目结构3项目结构4

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' 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM