Build Android Project Error

It’s working in Unity4.6.1
But when I upgrade to Unity5.2.0 it’s has error
What should I do?

CommandInvokationFailure: Failed to re-package resources. See the Console for details.
D:\Android\android-sdk\build-tools\23.0.1\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S “res” -I “D:/Android/android-sdk\platforms\android-23\android.jar” -F bin/resources.ap_

stderr[
AndroidManifest.xml:31: error: Error: No resource found that matches the given name (at ‘theme’ with value ’ @ /transparent’).

AndroidManifest.xml:33: error: Error: No resource found that matches the given name (at ‘theme’ with value ’ @ /transparent’).

AndroidManifest.xml:35: error: Error: No resource found that matches the given name (at ‘theme’ with value ’ @ /transparent’).

AndroidManifest.xml:39: error: Error: No resource found that matches the given name (at ‘theme’ with value ’ @ /transparent’).

]
stdout[
Configurations:
(default)
xhdpi-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
values\strings.xml
Src: () res\values\strings.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
Type values
values\strings.xml
Src: () res\values\strings.xml
Including resources from package: D:\Android\android-sdk\platforms\android-23\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 mipmap
Processing image: res\drawable-xhdpi\app_banner.png
Processing image: res\drawable\app_icon.png
(processed image res\drawable\app_icon.png: 94% size of source)
(processed image res\drawable-xhdpi\app_banner.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)
]
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.PostProcessAndroidPlayer.Exec (System.String command, System.String args, System.String workingdir, System.String[ ] progress_strings, Single progress_value, System.String errorMsg)
UnityEditor.Android.PostProcessAndroidPlayer.CompileResources (System.String stagingArea, System.String packageName, UnityEditor.Android.AndroidLibraries androidLibraries)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcessInternal (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry)
UnityEditor.HostView:OnGUI()

Are you defining your own styles somewhere? do you have a res/ folder under Assets/Plugins ?

If so, this does not work anymore with 5.2…

2330158--157344--20151008141520.png It’s very simple scene

You can’t have a res/ folder directly under Assets/Plugins/Android with 5.2.

You can use my helper package that will automatically transition it into a supported state: https://dl.dropboxusercontent.com/u/31384095/Unity/UpdateResAndroid.unitypackage

Import that into your project, then right-click in the project window, and select “Convert res to Android Library”.
Make sure to backup your project before running this! (just to be on the safe side).

Then try to build and see if there’s any difference.

It’s still not working…

CommandInvokationFailure: Failed to re-package resources. See the Console for details.
D:\Android\android-sdk\build-tools\23.0.1\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S “res” -I “D:/Android/android-sdk\platforms\android-23\android.jar” -F bin/resources.ap_ --extra-packages -S “D:\Unity Project5.2\Unity Project5.2TEST\Temp\StagingArea\android-libraries\ResourcesLibrary\res”

stderr[
D:\Unity Project5.2\Unity Project5.2TEST\Temp\StagingArea\android-libraries\ResourcesLibrary\res\values\strings.xml: error: Duplicate file.
res\values\strings.xml: Original is here.
]
stdout[
Processing raw dir ‘D:\Unity Project5.2\Unity Project5.2TEST\Temp\StagingArea\android-libraries\ResourcesLibrary\res’
]
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.PostProcessAndroidPlayer.Exec (System.String command, System.String args, System.String workingdir, System.String[ ] progress_strings, Single progress_value, System.String errorMsg)
UnityEditor.Android.PostProcessAndroidPlayer.CompileResources (System.String stagingArea, System.String packageName, UnityEditor.Android.AndroidLibraries androidLibraries)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcessInternal (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry)
UnityEditor.HostView:OnGUI()

Final I add a ‘package’ attribute to Assets/Plugins/Android/ResourcesLibrary/AndroidManifest.xml
It’s working~
Thanks!

1 Like

What do you mean add a “package” attribute ? could you elaborate? i’d like to update my script so it can do all the magic without having to do anything manually.

this is my AndroidManifest.xml


this is you AndroidManifest.xml

If there is no package=“com.teoyoo.likui”
Will have this issue