简体   繁体   English

Android支持库v7缺少appcompat

[英]Android Support Library v7 missing appcompat

So when I import the Android Support Library v7 (appcompat JAR), I see that I get a noclassdeferror when trying to use it. 因此,当我导入Android支持库v7(appcompat JAR)时,我发现尝试使用它时出现noclassdeferror。 This is because the package android.support.v7.appcompat is not being found as it is not even there in appCompat.JAR. 这是因为找不到包android.support.v7.appcompat,因为appCompat.JAR中甚至都没有。 I confirmed this by extracting the contents of the JAR file. 我通过提取JAR文件的内容来确认这一点。 I tried reinstalling the JAR with SDK Manager, however I am missing the same package every time. 我尝试使用SDK Manager重新安装JAR,但是每次都缺少相同的软件包。 Can someone tell me what's going wrong? 有人可以告诉我怎么了吗?

Thanks 谢谢

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.. 您必须将appcompat库导入到您的项目中...请检查以下链接以获取如何在项目中设置appcompat的信息。

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

thank you 谢谢

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". 是的,我知道我需要使用“ SDK管理器”对话框,按照“ 支持库设置”链接从extras文件夹下载支持库,但该未在其中列出-只有“支持库”。

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. 然后可以下载。

You need to import support 您需要导入支持

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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