[Bug]: Android build error with API Level 34 AND Unity 2020.3.42
What happened?
BUILD ERROR
- What went wrong: Execution failed for task ':launcher:processReleaseResources'.
A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction AAPT2 aapt2-4.2.1-7147631-windows Daemon #0: Unexpected error during link, attempting to stop daemon. This should not happen under normal circumstances, please file an issue if it does.
Error is AAPT2 aapt2-4.2.1-7147631-windows Daemon #0: Unexpected error during link, attempting to stop daemon.
Build Success without OneSignal Plugin
Error unity form : https://forum.unity.com/threads/cant-build-for-android-34.1486539/
Steps to reproduce?
1. create blank project
2. import OneSignal plugins
3. build android apk with API Level 34
What did you expect to happen?
Please fix this issue
Unity version
2020.3.42
OneSignal Unity SDK version
5.1.7
Platform
Android
Relevant log output
No response
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
@super3dgames thanks for reporting!
I read through Unity forum link you shared and the concussion seems to be that OneSignal uses androidx.legacy:legacy-support-v4 which isn't compatible specifically when targeting Android API Level 34 AND using an older version of AGP (Android Gradle Plugin)
The options to resolve this issue are:
- Wait for PR https://github.com/OneSignal/OneSignal-Unity-SDK/issues/746 to land in a future OneSignal-Unity-SDK update.
- Upgrade to Unity 2022.3 or higher (since this uses a newer enough AGP version)
- Export your game as an Android Studio Project. Update the requirements to minimum AGP 7.2.0 / Gradle 7.2.0 / Java 11 (source)
- Target Android API Level 33. (temporary, as Google Play Store requires API 34 starting 2024/08/31, however you may request an extension from them)
Thanks for your answer . but with Target Android API Level 33 we already success to build apk.
We will try your provided steps.
Closing due to inactivity. If you are still having issues, feel free to open a new issue