简体   繁体   English

AAPT:错误:“#ffffff”与可绘制属性 (attr) 引用不兼容

[英]AAPT: error: '#ffffff' is incompatible with attribute drawable (attr) reference

I'm new to android programming so what I did was I created an application.我是 android 编程的新手,所以我所做的是创建了一个应用程序。

I made a backup of the whole application folder so I can repaste it again if ever I had troubles.我对整个应用程序文件夹进行了备份,以便在遇到问题时可以重新粘贴。

Now that I copy and pasted the backup files to the current project folder.现在我将备份文件复制并粘贴到当前项目文件夹中。 Everything went nuts.一切都变得疯狂。

An error saying一个错误的说法

"AAPT: error: '#ffffff' is incompatible with attribute drawable (attr) reference." “AAPT:错误:'#ffffff' 与属性可绘制 (attr) 引用不兼容。”

"AAPT: error: resource style/AppTheme.AppBarOverlay (aka com.example.reviewerapplication:style/AppTheme.AppBarOverlay) not found." “AAPT:错误:找不到资源样式/AppTheme.AppBarOverlay(又名 com.example.reviewerapplication:style/AppTheme.AppBarOverlay)。”

"AAPT: error: attribute navGraph (aka com.example.reviewerapplication:navGraph) not found." “AAPT:错误:找不到属性 navGraph(又名 com.example.reviewerapplication:navGraph)。”

That is just 3 samples of the 100+ errors with the same "AAPT" on it.这只是 100 多个错误中的 3 个样本,上面带有相同的“AAPT”。

Can anyone please help me...谁能帮帮我吗...

"AAPT: error: '#ffffff' is incompatible with attribute drawable (attr) reference."

You are using a color in a drawable attribute.您在drawable属性中使用color You have to use a drawable resources ( @drawable/... )您必须使用drawable资源( @drawable/...

"AAPT: error: resource style/AppTheme.AppBarOverlay (aka com.example.reviewerapplication:style/AppTheme.AppBarOverlay) not found."

You are linking the @style/AppTheme.AppBarOverlay but it doesn't exist in your res/values/styles.xml file.您正在链接@style/AppTheme.AppBarOverlay但它在您的res/values/styles.xml文件中不存在。

"AAPT: error: attribute navGraph (aka com.example.reviewerapplication:navGraph) not found."

It seems that you have to add in your build.gradle some dependencies:看来您必须在build.gradle中添加一些依赖项:

dependencies {
  def nav_version = "2.3.0-rc01"

  implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
  implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
}

暂无
暂无

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

相关问题 Android Studio:底部导航视图 - AAPT:错误:“”与可绘制属性 (attr) 参考不兼容 - Android Studio: Bottom Navigation View - AAPT: error: ' ' is incompatible with attribute drawable (attr) reference AAPT:错误:“”与属性 fullBackupContent (attr) 引用不兼容|布尔值 - AAPT: error: '' is incompatible with attribute fullBackupContent (attr) reference|boolean 如何排除故障:AAPT:错误:与属性 src (attr) 参考|颜色不兼容 - How to troubleshoot: AAPT: error: is incompatible with attribute src (attr) reference|color AAPT: 错误: '' 与属性 allowBackup (attr) 不兼容 boolean - AAPT: error: '' is incompatible with attribute allowBackup (attr) boolean AAPT:错误:“+@id/nav_nightlife”与属性 id (attr) 参考不兼容 - AAPT: error: '+@id/nav_nightlife' is incompatible with attribute id (attr) reference AAPT:错误:“0”与属性 layout_constraintEnd_toEndOf (attr) 参考不兼容|枚举 [parent=0] - AAPT: error: '0' is incompatible with attribute layout_constraintEnd_toEndOf (attr) reference|enum [parent=0] 错误:错误:'drawable/delete.png' 与属性 android:background (attr) 引用不兼容|颜色 - Error:error: 'drawable/delete.png' is incompatible with attribute android:background (attr) reference|color 如何修复 AAPT:错误:'???dp' 与属性 layout_marginEnd (attr) 维度不兼容 - How to fix AAPT: error: '???dp' is incompatible with attribute layout_marginEnd (attr) dimension 错误:(26)错误:''与属性android:icon(attr)引用不兼容 - Error:(26) error: ' ' is incompatible with attribute android:icon (attr) reference 错误:错误:'' 与属性 android:background (attr) 引用不兼容|颜色 - Error:error: '' is incompatible with attribute android:background (attr) reference|color
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM