Search Issue Tracker

Won't Fix

Votes

0

Found in

2023.1.0a18

Issue ID

UUM-19493

Regression

No

[Android] Build Report Inspector generates "apkanalyzer failed to estimate the apk size. Output: Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8" exception on Build when using Java Environment Variable

--

-

How to reproduce:
1. Go to “Edit the system environment variables” > “Environment Variables…” > “New”
2. Add “JAVA_TOOL_OPTIONS“ as a Variable name and “-Dfile.encoding=UTF-8“ as a Variable value
3. Create a new Unity project
4. Go to “Package Manager“ > “Add package from git URL“ and add “com.unity.build-report-inspector“ URL
5. Build for Android
6. After the Build is complete observe the Console

Expected result: There are no exceptions
Actual result: “System.Exception: apkanalyzer failed to estimate the apk size. Output: Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8“ exception appears

Reproducible with: 0.2.2-preview, 0.3.0-preview (2020.3.42f1, 2021.3.14f1, 2022.1.23f1, 2022.2.0b16, 2023.1.0a20)

Not reproducible on: iOS, Standalone Player (Windows 11)

Note: After setting Environment Variable a Unity Hub / PC restart may be needed

Full exception message:
System.Exception: apkanalyzer failed to estimate the apk size. Output:
18131288
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
at Unity.BuildReportInspector.Mobile.AndroidUtilities.GetApkDownloadSize (System.String applicationPath) [0x001e5] in Project Path\Library\PackageCache\com.unity.build-report-inspector@0.3.0-preview\Editor\Mobile\AndroidUtilities.cs:253
at Unity.BuildReportInspector.Mobile.AndroidUtilities.GetArchitectureInfo (System.String applicationPath) [0x000f3] in Project Path\Library\PackageCache\com.unity.build-report-inspector@0.3.0-preview\Editor\Mobile\AndroidUtilities.cs:128
at Unity.BuildReportInspector.Mobile.MobileAppendix..ctor (System.String applicationPath) [0x000d8] in Project Path\Library\PackageCache\com.unity.build-report-inspector@0.3.0-preview\Editor\Mobile\MobileAppendix.cs:90
at Unity.BuildReportInspector.Mobile.MobileHelper.GenerateMobileAppendix (System.String applicationPath, System.String guid) [0x0001e] in Project Path\Library\PackageCache\com.unity.build-report-inspector@0.3.0-preview\Editor\Mobile\MobileHelper.cs:77
UnityEngine.Debug:LogError (object)
Unity.BuildReportInspector.Mobile.MobileHelper:GenerateMobileAppendix (string,string) (at Library/PackageCache/com.unity.build-report-inspector@0.3.0-preview/Editor/Mobile/MobileHelper.cs:83)
Unity.BuildReportInspector.Mobile.MobileHelper:GenerateAndroidAppendix (string,string) (at Library/PackageCache/com.unity.build-report-inspector@0.3.0-preview/Editor/Mobile/MobileHelper.cs:27)
Unity.BuildReportInspector.Mobile.PostBuildSetup:BuildPostProcess (UnityEditor.BuildTarget,string) (at Library/PackageCache/com.unity.build-report-inspector@0.3.0-preview/Editor/Mobile/PostBuildSetup.cs:44)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

  1. Resolution Note:

    The bug is in the "Build Report Inspector" so I've transferred the ticket to the github issues for that package.

    https://github.com/Unity-Technologies/BuildReportInspector/issues/29

    The resolution field doesn't have an appropriate category for this sort of ticket system transfer, so I am forced to put "Won't fix"

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.