android - 找不到 Theme.AppCompat
问题描述
Error retrieving parent for item: No resource found that matches the
given name 'Theme.AppCompat'.
构建.gradle
样式.xml
AndroidManifest.xml
日志猫
解决方案
删除supportv4
库并添加:
implementation "com.android.support:support-core-utils:27.1.1"
并且(如果您不这样做)在您的顶级build.gradle
文件中包含 Google 的 Maven 存储库(更多信息在这里)。
allprojects {
repositories {
google()
// If you're using a version of Gradle lower than 4.1, you must
// instead use:
//
// maven {
// url 'https://maven.google.com'
// }
}
}
还要使用实现更新编译并确保所有依赖项都更新到最新版本,例如:
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
最后替换样式并尝试以下操作:
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
推荐阅读
- python - 在json文件中搜索值以获取数字(python)
- php - 尝试将数据从表单传递到 NGINX 到 Icinga2 API
- django - 我想将三个 js 项目添加到 Django 项目中。谁能指导我如何更新 settings.py 文件并显示目录的树结构
- apollo-client - 有没有办法配置 websocket 链接 ON 订阅以进行身份验证?
- macos - 安装 CPAN 模块时如何指定外部库文件位置
- sendgrid - 验证发件人电子邮件需要用户登录到 sendgrid
- javascript - 当我使用 r 将鼠标悬停在 Plotly 中时,如何按大小或颜色突出显示特定点(在散点图中)
- c# - 注册以创建“SaasKit.Multitenancy.TenantContext`1[Owl.Implementations.AppTenant]”实例的委托返回 null
- javascript - 如何在 const 字符串中添加换行符/换行符?
- python - 关于 re.findall