简体   繁体   English

Unity构建错误:找不到与给定名称“ android:Theme.Holo.Light.NoActionBar.Fullscreen”匹配的资源

[英]Unity build error: No resource found that matches the given name 'android:Theme.Holo.Light.NoActionBar.Fullscreen'

I'm building a Unity project and when I'm trying to build the project for android, I get this error: 我正在构建一个Unity项目,当我尝试为android构建项目时,出现以下错误:

error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light.NoActionBar.Fullscreen'. 错误:检索项目的父项时出错:找不到与给定名称“ android:Theme.Holo.Light.NoActionBar.Fullscreen”匹配的资源。

I know these kinda errors can be fixed when creating an android project using Android Studio by modifying manifest file or something like that. 我知道在通过修改清单文件或类似的东西使用Android Studio创建android项目时可以解决这些错误。 But how can I fix such errors in Unity? 但是如何在Unity中修复此类错误?

Here's the full error: 这是完整的错误:

Error building Player: CommandInvokationFailure: Failed to re-package resources. 构建Player时出错:CommandInvokationFailure:无法重新打包资源。 See the Console for details. 有关详细信息,请参见控制台。 C:\\Program Files (x86)\\Android\\android-sdk\\build-tools\\android-6.0\\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Program Files (x86)/Android/android-sdk\\platforms\\android-7\\android.jar" -F bin/resources.ap_ C:\\ Program Files(x86)\\ Android \\ android-sdk \\ build-tools \\ android-6.0 \\ aapt.exe软件包--auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S “ res” -I“ C:/ Program Files(x86)/Android/android-sdk\\platforms\\android-7\\android.jar” -F bin / resources.ap_

stderr[ res\\values-v14\\styles.xml:3: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light.NoActionBar.Fullscreen'. stderr [res \\ values-v14 \\ styles.xml:3:错误:检索项目父项时出错:未找到与给定名称'android:Theme.Holo.Light.NoActionBar.Fullscreen'相匹配的资源。

res\\values-v21\\styles.xml:3: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Light.NoActionBar.Fullscreen'. res \\ Values-v21 \\ styles.xml:3:错误:检索项目父项时出错:未找到与给定名称'android:Theme.Material.Light.NoActionBar.Fullscreen'相匹配的资源。

] stdout[ Configurations: (default) v14 v21 ldpi-v4 hdpi-v4 xhdpi-v4 xxhdpi-v4 xxxhdpi-v4 ] stdout [配置:(默认)v14 v21 ldpi-v4 hdpi-v4 xhdpi-v4 xxhdpi-v4 xxxhdpi-v4

Files: drawable\\app_banner.png Src: (xhdpi-v4) res\\drawable-xhdpi\\app_banner.png drawable\\app_icon.png Src: () res\\drawable\\app_icon.png Src: (ldpi-v4) res\\drawable-ldpi\\app_icon.png Src: (hdpi-v4) res\\drawable-hdpi\\app_icon.png Src: (xhdpi-v4) res\\drawable-xhdpi\\app_icon.png Src: (xxhdpi-v4) res\\drawable-xxhdpi\\app_icon.png Src: (xxxhdpi-v4) res\\drawable-xxxhdpi\\app_icon.png values\\strings.xml Src: () res\\values\\strings.xml values\\styles.xml Src: () res\\values\\styles.xml Src: (v14) res\\values-v14\\styles.xml Src: (v21) res\\values-v21\\styles.xml AndroidManifest.xml Src: () AndroidManifest.xml 文件:drawable \\ app_banner.png Src:(xhdpi-v4)res \\ drawable-xhdpi \\ app_banner.png drawable \\ app_icon.png Src :()res \\ drawable \\ app_icon.png Src:(ldpi-v4)res \\ drawable- ldpi \\ app_icon.png Src:(hdpi-v4)res \\ drawable-hdpi \\ app_icon.png Src:(xhdpi-v4)res \\ drawable-xhdpi \\ app_icon.png Src:(xxhdpi-v4)res \\ drawable-xxhdpi \\ app_icon.png Src:(xxxhdpi-v4)res \\ drawable-xxxhdpi \\ app_icon.png values \\ strings.xml Src:()res \\ values \\ strings.xml values \\ styles.xml Src:()res \\ values \\ styles。 xml Src:(v14)res \\ values-v14 \\ styles.xml Src:(v21)res \\ values-v21 \\ styles.xml AndroidManifest.xml Src:()AndroidManifest.xml

Resource Dirs: Type drawable drawable\\app_banner.png Src: (xhdpi-v4) res\\drawable-xhdpi\\app_banner.png drawable\\app_icon.png Src: () res\\drawable\\app_icon.png Src: (ldpi-v4) res\\drawable-ldpi\\app_icon.png Src: (hdpi-v4) res\\drawable-hdpi\\app_icon.png Src: (xhdpi-v4) res\\drawable-xhdpi\\app_icon.png Src: (xxhdpi-v4) res\\drawable-xxhdpi\\app_icon.png Src: (xxxhdpi-v4) res\\drawable-xxxhdpi\\app_icon.png Type values values\\strings.xml Src: () res\\values\\strings.xml values\\styles.xml Src: () res\\values\\styles.xml Src: (v14) res\\values-v14\\styles.xml Src: (v21) res\\values-v21\\styles.xml Including resources from package: C:\\Program Files (x86)\\Android\\android-sdk\\platforms\\android-7\\android.jar applyFileOverlay for drawable applyFileOverlay for layout applyFileOverlay for anim applyFileOverlay for animator applyFileOverlay for interpolator applyFileOverlay for transition applyFileOverlay for xml applyFileOverlay for raw applyFileOverlay for color applyFileOverlay for menu applyFileOverlay for mi 资源目录:类型drawable drawable \\ app_banner.png Src:(xhdpi-v4)res \\ drawable-xhdpi \\ app_banner.png drawable \\ app_icon.png Src:()res \\ drawable \\ app_icon.png Src:(ldpi-v4)res \\ drawable-ldpi \\ app_icon.png Src:(hdpi-v4)res \\ drawable-hdpi \\ app_icon.png Src:(xhdpi-v4)res \\ drawable-xhdpi \\ app_icon.png Src:(xxhdpi-v4)res \\ drawable -xxhdpi \\ app_icon.png Src:(xxxhdpi-v4)res \\ drawable-xxxhdpi \\ app_icon.png类型值values \\ strings.xml Src:()res \\ values \\ strings.xml values \\ styles.xml Src:()res \\ values \\ styles.xml Src:(v14)res \\ values-v14 \\ styles.xml Src:(v21)res \\ values-v21 \\ styles.xml包括软件包中的资源:C:\\ Program Files(x86)\\ Android \\ android-sdk \\ platforms \\ android-7 \\ android.jar applyFileOverlay用于可绘制的applyFileOverlay用于布局applyFileOverlay用于动画设计applyFileOverlay用于动画设计器applyFileOverlay用于内插器applyFileOverlay用于过渡applyFileOverlay用于xml applyFileOverlay用于原始applyFileOverlay用于颜色applyFileOverlay用于菜单 pmap Processing image: res\\drawable-xhdpi\\app_banner.png Processing image: res\\drawable\\app_icon.png (processed image res\\drawable\\app_icon.png: 98% size of source) Processing image: res\\drawable-ldpi\\app_icon.png Processing image: res\\drawable-hdpi\\app_icon.png (processed image res\\drawable-xhdpi\\app_banner.png: 93% size of source) Processing image: res\\drawable-xhdpi\\app_icon.png Processing image: res\\drawable-xxhdpi\\app_icon.png (processed image res\\drawable-hdpi\\app_icon.png: 95% size of source) Processing image: res\\drawable-xxxhdpi\\app_icon.png (processed image res\\drawable-ldpi\\app_icon.png: 97% size of source) (processed image res\\drawable-xhdpi\\app_icon.png: 95% size of source) (processed image res\\drawable-xxhdpi\\app_icon.png: 92% size of source) (processed image res\\drawable-xxxhdpi\\app_icon.png: 93% size of source) (new resource id app_banner from xhdpi-v4\\drawable\\app_banner.png #generated) (new resource id app_icon from drawable\\app_icon.png #generated) (new resource id a pmap处理图像:res \\ drawable-xhdpi \\ app_banner.png处理图像:res \\ drawable \\ app_icon.png(处理后的图像res \\ drawable \\ app_icon.png:98%的源大小)处理图像:res \\ drawable-ldpi \\ app_icon .png处理图像:res \\ drawable-hdpi \\ app_icon.png(处理后的图像res \\ drawable-xhdpi \\ app_banner.png:93%的源大小)处理图像:res \\ drawable-xhdpi \\ app_icon.png处理图像:res \\ drawable-xxhdpi \\ app_icon.png(处理后的图像res \\ drawable-hdpi \\ app_icon.png:源大小的95%)处理图像:res \\ drawable-xxxhdpi \\ app_icon.png(处理后的图像res \\ drawable-ldpi \\ app_icon.png :来源大小为97%)(处理后的图像res \\ drawable-xhdpi \\ app_icon.png:来源大小为95%)(处理后的图像res \\ drawable-xxhdpi \\ app_icon.png:来源的大小为92%)(处理后的图像res \\ drawable-xxxhdpi \\ app_icon.png:源大小的93%)(来自xhdpi-v4 \\ drawable \\ app_banner.png#生成的新资源ID app_banner)(来自drawable \\ app_icon.png#生成的新资源ID app_icon)(新资源ID一种 pp_icon from ldpi-v4\\drawable\\app_icon.png #generated) (new resource id app_icon from hdpi-v4\\drawable\\app_icon.png #generated) (new resource id app_icon from xhdpi-v4\\drawable\\app_icon.png #generated) (new resource id app_icon from xxhdpi-v4\\drawable\\app_icon.png #generated) (new resource id app_icon from xxxhdpi-v4\\drawable\\app_icon.png #generated) ] pp_icon来自ldpi-v4 \\ drawable \\ app_icon.png#生成)(新资源ID app_icon来自hdpi-v4 \\ drawable \\ app_icon.png#生成)(xhdpi-v4 \\ drawable \\ app_icon.png#生成新资源ID app_icon (来自xxhdpi-v4 \\ drawable \\ app_icon.png#生成的新资源ID app_icon)(来自xxxhdpi-v4 \\ drawable \\ app_icon.png#生成的新资源id app_icon)

This is possibly a bug in Unity. 这可能是Unity中的错误。 I know this is a bit late, but in case someone else runs into the same problem. 我知道这有点晚了,但是如果有人遇到同样的问题。 This is work-around of how I got rid of the error: 这是解决该错误的方法:

  1. In the Unity Editor click Edit -> Project Settings -> Player 在Unity编辑器中,单击编辑->项目设置->播放器
  2. In the Inspector click on Android Settings (Android icon) 在检查器中,单击“ Android设置”(Android图标)
  3. In the Player Settings panel top right corner you will find a very small gear icon. 在“播放器设置”面板的右上角,您会发现一个非常小的齿轮图标。 Click on it and select the "Reset" pop up menu. 单击它,然后选择“重置”弹出菜单。

This will reset your player settings back to the defaults that should compile at least. 这会将您的播放器设置重置为至少应该编译的默认设置。 For me this took the error away. 对我来说,这消除了错误。

Once the project is compiling again, you can manually re-apply your settings one by one in the Player Settings panel until you find the culprit setting cause the issue and file a bug report at Unity. 项目重新编译后,您可以在“播放器设置”面板中手动一个接一个地重新应用您的设置,直到找到导致该问题的罪魁祸首并向Unity提交错误报告。

暂无
暂无

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

相关问题 AAPT:错误:资源样式/Theme.Holo.Light.NoActionBar.Fullscreen - AAPT: error: resource style/Theme.Holo.Light.NoActionBar.Fullscreen 找不到匹配给定名称'android:Theme.Holo.Light'的资源 - No resource found that matches the given name 'android:Theme.Holo.Light' 键入错误:检索项目的父项时出错:未找到与给定名称'android:Theme.Holo.Light'相匹配的资源。 - Type error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light'. 错误:检索父项时出错:找不到与给定名称'android:Theme.Holo.Light.DarkActionBar'匹配的资源 - error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light.DarkActionBar' 错误:检索项目的父项时出错:找不到与给定名称“ Theme.AppCompat.Light.NoActionBar”匹配的资源 - error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.NoActionBar' 找不到与给定名称匹配的资源'@android:style / Theme.Material.Light.DialogWhenLarge.NoActionBar' - No resource found that matches the given name '@android:style/Theme.Material.Light.DialogWhenLarge.NoActionBar' 找不到与给定名称“ android:Theme.Holo.Light.DarkActionBar”匹配的资源 - No resource found that matches the given name 'android:Theme.Holo.Light.DarkActionBar' 错误:检索项目的父项时出错:找不到与给定名称“android:Theme.Holo”匹配的资源 - error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo' 找不到与给定名称'@ style / Theme.Holo.Light.DarkActionBar'匹配的资源 - No resource found that matches the given name '@style/ Theme.Holo.Light.DarkActionBar' 找不到与给定名称'@ style / Theme.Holo.Light.DarkActionBar匹配的资源 - No resource found that matches the given name '@style/ Theme.Holo.Light.DarkActionBar
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM