Search Unity

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

Discussion in 'Android' started by acme3D, Jan 9, 2020.

  1. acme3D

    acme3D

    Joined:
    Feb 4, 2009
    Posts:
    203
    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 <f92457847c324e90907abe57dde6951d>:0)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <f92457847c324e90907abe57dde6951d>:0)
    UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, System.String errorMsg) (at <f92457847c324e90907abe57dde6951d>:0)
    UnityEditor.Android.PostProcessor.Tasks.BuildResources.CompileResources (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <f92457847c324e90907abe57dde6951d>:0)
    UnityEditor.Android.PostProcessor.Tasks.BuildResources.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <f92457847c324e90907abe57dde6951d>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <f92457847c324e90907abe57dde6951d>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)​
     
  2. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    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.
     
  3. acme3D

    acme3D

    Joined:
    Feb 4, 2009
    Posts:
    203
    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.

    https://developer.oculus.com/blog/b...ty-of-your-gear-vr-application-for-oculus-go/
    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?
     
  4. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    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.
     
  5. acme3D

    acme3D

    Joined:
    Feb 4, 2009
    Posts:
    203
    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.
     
  6. acme3D

    acme3D

    Joined:
    Feb 4, 2009
    Posts:
    203
    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...
     
  7. Strategos

    Strategos

    Joined:
    Aug 24, 2012
    Posts:
    255
    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 ?
     
  8. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    2018.4.18 should contain the fix.
     
    Strategos likes this.
  9. Strategos

    Strategos

    Joined:
    Aug 24, 2012
    Posts:
    255
    When will this be released?
     
  10. Fenrisul

    Fenrisul

    Joined:
    Jan 2, 2010
    Posts:
    618
    Prodding here too for good measure, glad this is a known issue... Encountered in 2019.3.0f6 and 2019.3.1f1 as well.
     
    Strategos likes this.
  11. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    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.
     
  12. Fenrisul

    Fenrisul

    Joined:
    Jan 2, 2010
    Posts:
    618
    Thanks.

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

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    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.
     
  14. Strategos

    Strategos

    Joined:
    Aug 24, 2012
    Posts:
    255
    Where can I download 2018.4.18f1 ? I don't see it anywhere

    I see:
    LTS Release 2018.4.17f1
    Released: 11 February 2020
     
  15. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    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.
     
    Strategos likes this.
  16. Strategos

    Strategos

    Joined:
    Aug 24, 2012
    Posts:
    255
    Any news on this ?
     
  17. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    Thanks for your patience. The release is planned for today-tomorrow. If everything goes well, it will be released this week.
     
    Strategos likes this.