Skip to content

[Android] Add export check for "game_view_content_description" in strings.xml #1013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,21 @@ private static void ModifyAndroidGradle(bool isPlugin)
var proguardText = File.ReadAllText(proguardFile);
proguardText = proguardText.Replace("-ignorewarnings", "-keep class com.xraph.plugin.** { *; }\n-keep class com.unity3d.plugin.* { *; }\n-ignorewarnings");
File.WriteAllText(proguardFile, proguardText);

// Make sure "game_view_content_description" is in strings.xml
var stringsFile = Path.Combine(APKPath, "launcher", "src", "main", "res", "values", "strings.xml");
if(File.Exists(stringsFile))
{
var stringsText = File.ReadAllText(stringsFile);
if(!stringsText.Contains("game_view_content_description"))
{
stringsText = stringsText.Replace("<resources>", "<resources>\n <string name=\"game_view_content_description\">Game view</string>");
File.WriteAllText(stringsFile, stringsText);
}
} else
{
Debug.LogError("Android res/values/strings.xml file not found during export.");
}
}

private static void BuildIOS(String path, bool isReleaseBuild)
Expand Down
3 changes: 2 additions & 1 deletion unitypackages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Changes for `2022.1.7f1` and earlier were collected retroactively and might not

## Pending (master branch)
> Example Unity project, not in a unitypackage yet.
* *No changes*
* (Android) Handle missing `"game_view_content_description"` string in Unity output strings.xml.

## 2022.3.0
>fuw-2022.3.0.unitypackage
Expand All @@ -43,6 +43,7 @@ Changes for `2022.1.7f1` and earlier were collected retroactively and might not
* (Web) Fix Javascript error on Play and Pause.
* (Android) Fix build error `resource style/UnityThemeSelector not found` in the example project.
* Use Il2CppCodeGeneration.OptimizeSpeed in Android and iOS release exports.
* (Android) Handle new .gradle.kts files in Flutter 3.29+.


## 2022.2.0
Expand Down