gpt4 book ai didi

java - 找不到错误 : resource style/Animation. AppCompat.Dialog(又名 com.example.myapplication :style/Animation. AppCompat.Dialog)

转载 作者:搜寻专家 更新时间:2023-10-31 20:24:53 27 4
gpt4 key购买 nike

我是 Android 的新手,正在尝试使用 android studio 版本 3.3.2 开发 hello 应用程序。我正在尝试创建默认导航 Activity 项目,并在构建期间给出如下错误。

Android resource linking failed
error: resource style/Animation.AppCompat.Dialog (aka com.example.myapplication:style/Animation.AppCompat.Dialog) not found.
error: resource style/Theme.AppCompat.Light.DarkActionBar (aka com.example.myapplication:style/Theme.AppCompat.Light.DarkActionBar) not found.
error: resource style/ThemeOverlay.AppCompat.Dark.ActionBar (aka com.example.myapplication:style/ThemeOverlay.AppCompat.Dark.ActionBar) not found.
F:\MyApplication2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:401: error: style attribute 'attr/windowActionBar (aka com.example.myapplication:attr/windowActionBar)' not found.
F:\MyApplication2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:402: error: style attribute 'attr/windowNoTitle (aka com.example.myapplication:attr/windowNoTitle)' not found.
F:\MyApplication2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v21\values-v21.xml:8: error: style attribute 'attr/windowActionBar (aka com.example.myapplication:attr/windowActionBar)' not found.
F:\MyApplication2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v21\values-v21.xml:9: error: style attribute 'attr/windowNoTitle (aka com.example.myapplication:attr/windowNoTitle)' not found.
error: resource style/ThemeOverlay.AppCompat.Light (aka com.example.myapplication:style/ThemeOverlay.AppCompat.Light) not found.
F:\MyApplication2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:416: error: resource style/Widget.AppCompat.ListView.Menu (aka com.example.myapplication:style/Widget.AppCompat.ListView.Menu) not found.
F:\MyApplication2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:417: error: resource style/Animation.AppCompat.DropDownUp (aka com.example.myapplication:style/Animation.AppCompat.DropDownUp) not found.
F:\MyApplication2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:421: error: style attribute 'attr/windowMinWidthMajor (aka com.example.myapplication:attr/windowMinWidthMajor)' not found.
F:\MyApplication2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:422: error: style attribute 'attr/windowMinWidthMinor (aka com.example.myapplication:attr/windowMinWidthMinor)' not found.
F:\MyApplication2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:425: error: style attribute 'attr/windowFixedWidthMajor (aka com.example.myapplication:attr/windowFixedWidthMajor)' not found.
F:\MyApplication2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:426: error: style attribute 'attr/windowFixedWidthMinor (aka com.example.myapplication:attr/windowFixedWidthMinor)' not found.
F:\MyApplication2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:427: error: style attribute 'attr/windowFixedHeightMajor (aka com.example.myapplication:attr/windowFixedHeightMajor)' not found.
F:\MyApplication2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:428: error: style attribute 'attr/windowFixedHeightMinor (aka com.example.myapplication:attr/windowFixedHeightMinor)' not found.
F:\MyApplication2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:431: error: style attribute 'attr/windowMinWidthMajor (aka com.example.myapplication:attr/windowMinWidthMajor)' not found.
F:\MyApplication2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:432: error: style attribute 'attr/windowMinWidthMinor (aka com.example.myapplication:attr/windowMinWidthMinor)' not found.
F:\MyApplication2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:438: error: style attribute 'attr/actionBarPopupTheme (aka com.example.myapplication:attr/actionBarPopupTheme)' not found.
F:\MyApplication2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:439: error: style attribute 'attr/actionBarWidgetTheme (aka com.example.myapplication:attr/actionBarWidgetTheme)' not found.

我有如下的项目 gradle 文件

apply plugin: 'com.android.application'

android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

我可以导入并运行另一个项目,但这会给我上面的错误。

最佳答案

AppCompat 是一个库项目。你需要在你的android项目中引用库项目

  1. 在项目的 build.gradle 文件中包含 Google 的 Maven 存储库

    所有项目{ 存储库{ 谷歌() 如果您使用的 Gradle 版本低于 4.1,则必须 而是使用: 行家{ 网址 ' https://maven.google.com ' } }

  2. 对于要在其中使用支持库的每个模块,将库添加到模块的 build.gradle 文件的依赖项 block 中。例如,要添加 v7 core-utils 库,请添加以下内容:

实现“com.android.support:support-core-utils:28.0.0”

关于java - 找不到错误 : resource style/Animation. AppCompat.Dialog(又名 com.example.myapplication :style/Animation. AppCompat.Dialog),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55435007/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com