简体   繁体   中英

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:

error: Error retrieving parent for item: No resource found that matches the given name '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. But how can I fix such errors in Unity?

Here's the full error:

Error building Player: CommandInvokationFailure: Failed to re-package resources. 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_

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'.

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'.

] stdout[ Configurations: (default) 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

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 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 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) ]

This is possibly a bug in 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
  2. In the Inspector click on Android Settings (Android icon)
  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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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