If you export the example project for Android with Unity 2023.3.x, you will get errors related to a missing style/UnityThemeSelector.
This is because the file that declares this style is accidentally deleted during the export, this pull request makes sure the file is kept.
Cause
During the unity export, the folder unityLibrary/src/main/res is accidentally deleted during a copy.
It first copies unity/<project>/Builds/<name>.apk/unityLibrary to android/unityLibrary.
unityLibrary/src/main/res now contains multiple files (may differ per Unity version)
freeformwindow.xml
ids.xml
styles.xml
Then it copies unity/<project>/Builds/<name>.apk/launcher/src/main/reson top of that.
This copy function deletes the destination folder.
So now unityLibrary/src/main/res only contains:
string.xml
The missing styles.xml file is now causing this issue.
Error message
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:processReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
> Android resource linking failed
C:\Users\User\Documents\unity_widget\example\build\app\intermediates\packaged_manifests\release\AndroidManifest.xml:81: error: resource style/UnityThemeSelector (aka com.xraph.plugin.flutter_unity_widget_example:style/UnityThemeSelector) not found.
error: failed processing manifest.
* 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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:bundleReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2ProcessResourcesRunnable
> Android resource linking failed
C:\Users\User\Documents\unity_widget\example\build\app\intermediates\bundle_manifest\release\AndroidManifest.xml:81: error: resource style/UnityThemeSelector (aka com.xraph.plugin.flutter_unity_widget_example:style/UnityThemeSelector) not found.
error: failed processing manifest.
* 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.
==============================================================================
Type of Change
[ ] โจ New feature (non-breaking change which adds functionality)
[x] ๐ ๏ธ Bug fix (non-breaking change which fixes an issue)
[ ] โ Breaking change (fix or feature that would cause existing functionality to change)
Description
If you export the example project for Android with Unity 2023.3.x, you will get errors related to a missing
style/UnityThemeSelector
. This is because the file that declares this style is accidentally deleted during the export, this pull request makes sure the file is kept.Cause
During the unity export, the folder
unityLibrary/src/main/res
is accidentally deleted during a copy.It first copies
unity/<project>/Builds/<name>.apk/unityLibrary
toandroid/unityLibrary
.unityLibrary/src/main/res
now contains multiple files (may differ per Unity version)Then it copies
unity/<project>/Builds/<name>.apk/launcher/src/main/res
on top of that. This copy function deletes the destination folder. So nowunityLibrary/src/main/res
only contains:The missing styles.xml file is now causing this issue.
Error message
Type of Change