(Case: 1356644) Error when building zh-Hans and zh-Hant AppInfo strings.xml

Hi, I think there are errors when using Unity build function with Android App Info localization implemented.

Below is the stack trace:

CommandInvokationFailure: Gradle build failed. 
/Applications/Unity/Hub/Editor/2020.3.11f1/PlaybackEngines/AndroidPlayer/OpenJDK/bin/java -classpath "/Applications/Unity/Hub/Editor/2020.3.11f1/PlaybackEngines/AndroidPlayer/Tools/gradle/lib/gradle-launcher-5.6.4.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleDebug"

stderr[
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
/Users/matthewmok/arcade-unity/arcade-unity/Temp/gradleOut/unityLibrary/src/main/res/values-b+zh-rHans: Resource and asset merger: Invalid resource directory name

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':unityLibrary:packageDebugResources'.
> /Users/matthewmok/arcade-unity/arcade-unity/Temp/gradleOut/unityLibrary/src/main/res/values-b+zh-rHans: Error: Invalid resource directory name

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

I find the error comes from Player.cs in Platform/Android/ folder line 73. which “-” in “zh-Hans” and “zh-Hant” is replaced by “-r”.

I will file a bug report as well.

1 Like

How should I workaround in this situation which we really need to build an app with metadata specifically using zh-Hans and zh-Hant?

Any news with this?

Happening in Localization package 1.2.1.

Failing when trying to create an Android AAB build:

C:\UnityProjects\Tallowmere2_Jan2017\Temp\gradleOut\unityLibrary\src\main\res\values-b+zh-rhans: Resource and asset merger: Invalid resource directory name

Is this is hard-coded typo somewhere or something? Simplified Chinese uses zh-hans, not zh-rhans, yeah?

Fixed.

Made the language code use zh-Hans. Builds successfully now.

7993107--1027194--upload_2022-3-25_22-24-4.png

Hey.
For some reason, I never got notified about replies to this thread.
Could someone please file a bug report for this? We dont have anything at the moment. If you post the bug # I will escalate it.