OneSignal-Unity-SDK icon indicating copy to clipboard operation
OneSignal-Unity-SDK copied to clipboard

[Bug]: Android build error with API Level 34 AND Unity 2020.3.42

Open super3dgames opened this issue 1 year ago • 2 comments

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 avatar Jul 14 '24 12:07 super3dgames

@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:

  1. Wait for PR https://github.com/OneSignal/OneSignal-Unity-SDK/issues/746 to land in a future OneSignal-Unity-SDK update.
  2. Upgrade to Unity 2022.3 or higher (since this uses a newer enough AGP version)
  3. Export your game as an Android Studio Project. Update the requirements to minimum AGP 7.2.0 / Gradle 7.2.0 / Java 11 (source)
  4. 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)

jkasten2 avatar Jul 15 '24 18:07 jkasten2

Thanks for your answer . but with Target Android API Level 33 we already success to build apk.
We will try your provided steps.

super3dgames avatar Jul 16 '24 06:07 super3dgames

Closing due to inactivity. If you are still having issues, feel free to open a new issue

shepherd-l avatar Sep 12 '24 17:09 shepherd-l