Error in building app GUIUtility.cs:179 BuildPlayerWindowBuildMethods.cs:19 BuildPlayerWindowBuild

I keep getting these errors when trying to build my app… Thing already done:

  • reinstalled fresh Android SDK
  • tested with a fresh new project (one scene, one cube, same errors)
    Any idea about what the problem could be?
    Using Unity 2018.4.14 LTS on Mac OS X 10.13.6

Build completed with a result of ‘Failed’
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)[/ICODE]

UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00242] in /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:194
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x0007f] in /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:97
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

CommandInvokationFailure: Failed to re-package resources.
/Users/fulvio/Library/Android/sdk/build-tools/29.0.2/aapt package --auto-add-overlay -v -f -m -J “gen” -M “AndroidManifest.xml” -S “res” -I “/Users/fulvio/Library/Android/sdk/platforms/android-21/android.jar” -F bin/resources.ap_

stderr[
AndroidManifest.xml:5: error: No resource identifier found for attribute ‘maxAspectRatio’ in package ‘android’

]
stdout[
Configurations:
(default)
v21
mdpi-v4

Files:
mipmap/app_icon.png
Src: (mdpi-v4) res/mipmap-mdpi/app_icon.png
values/strings.xml
Src: () res/values/strings.xml
values/styles.xml
Src: () res/values/styles.xml
Src: (v21) res/values-v21/styles.xml
AndroidManifest.xml
Src: () AndroidManifest.xml

Resource Dirs:
Type drawable
Type mipmap
mipmap/app_icon.png
Src: (mdpi-v4) res/mipmap-mdpi/app_icon.png
Type values
values/strings.xml
Src: () res/values/strings.xml
values/styles.xml
Src: () res/values/styles.xml
Src: (v21) res/values-v21/styles.xml
Including resources from package: /Users/fulvio/Library/Android/sdk/platforms/android-21/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 font
applyFileOverlay for mipmap
Processing image: res/mipmap-mdpi/app_icon.png
(processed image res/mipmap-mdpi/app_icon.png: 36% size of source)
(new resource id app_icon from mdpi-v4/mipmap/app_icon.png #generated)
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, System.String errorMsg) (at :0)
UnityEditor.Android.PostProcessor.Tasks.BuildResources.CompileResources (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0)
UnityEditor.Android.PostProcessor.Tasks.BuildResources.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

Hi, do you set target api level to 21 yourself intentionally or are you using the “Automatic (highest installed)” option? If latter, please install newer platform api levels (such as 28 or 29) and this issue should be gone.

Yes, I tried API 28 and 29 and they both work, The problem is that the app should run on Oculus GO, which has API 25. Oculus recommends to compile for the lowest API which is 21.

Oculus Go shipped with an Android API level of 25. If you happen to upload a Go-compatible application to your release channel with a minimum API that is higher than this level, your application will not show up on Oculus Go devices. It is best to set your application at the lowest API it run on and we currently recommend a minimum of API 21.

I tried all APIs up to 25 and same error pops up. If you compile with any API above 25 you won’t able to sideload the app on Oculus (so 28 and 29 do compile but you can’t install the app on the device). Any idea to get out of this dead end?

I see. This issue will be fixed, but I am not sure when. I think the only solution that you can do right now is to export your project, remove “maxAspectRatio” from the manifest and build the project in Android Studio.

Well, it looks like a big problem… I just tried 2019.2 and it tosses even more errors when you try to compile for API 21. If you compile for #29 then all is fine.
I understand that you should target the most recent API, but in Android world this isn’t always possible due to old or basic hardware.

Update: exported project, opened in Android Studio, removed maxAspectRatio from Manifest and then it compiles and works. Isn’t there a way to remove this straight from Unity compilation? This prevents using Buid & Run straight from Unity, whic is a real nuisance…

Ive just updated my project to Unity 2018.4.14 LTS (on windows) and am having the same problem Quest will not build , with this error and updating my API breaks everything.

Is the only solution to build using Android Studio ? !

When can we expect a fix for this ?

2018.4.18 should contain the fix.

1 Like

When will this be released?

Prodding here too for good measure, glad this is a known issue… Encountered in 2019.3.0f6 and 2019.3.1f1 as well.

1 Like

Currently this hasn’t been fixed in 2019.3 yet. The recommended workaround would be to export the project and manually remove “maxAspectRatio” from the manifest.

Thanks.

I wanted to add/confirm that this issue DOES NOT exist in 2018.4.11f1
Regression? Technically? not sure heh.

Yes, it was a regression in both 2018.4 and 2019.3 versions, but I am not sure in which versions exactly it was introduced. Maybe 2018.4.11f1 did not have it yet, but some later 2018.4 versions definitely had this issue, which was then fixed in 2018.4.18f1.

Where can I download 2018.4.18f1 ? I don’t see it anywhere

I see:
LTS Release 2018.4.17f1
Released: 11 February 2020

It was probably not released yet then. Usually the fixes for the latest LTS version are released in about every two weeks. So I would expect the 2018.4.18f1 to be released next week.

1 Like

Any news on this ?

Thanks for your patience. The release is planned for today-tomorrow. If everything goes well, it will be released this week.

1 Like