Android Support Library v7 missing appcompat

2019-08-08 10:09发布

问题:

So when I import the Android Support Library v7 (appcompat JAR), I see that I get a noclassdeferror when trying to use it. This is because the package android.support.v7.appcompat is not being found as it is not even there in appCompat.JAR. I confirmed this by extracting the contents of the JAR file. I tried reinstalling the JAR with SDK Manager, however I am missing the same package every time. Can someone tell me what's going wrong?

Thanks

回答1:

Also had this problem. Yes, I knew I need to use the SDK Manager dialog to download the support library from the extras folder, as per the Support Library Set-up link, but it wasn't listed there - there is only the "support repository".

The problem is that it is hidden by default, as it has been deprecated. You need to check the "show: obsolete" checkbox. And then it's available to download.



回答2:

You have to import the appcompat library in to your project...please check the following link for getting how to setup appcompat in your project..

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

thank you



回答3:

You need to import support

dependencies {
    ...
    implementation "com.android.support:support-core-utils:28.0.0"
}