Google is requiring targeting version 34, but I can’t get a build to succeed for this. 33 is fine. I’ve updated the SDK, but still just getting this error.
Hi @Gillissie
Google does not yet require to target API 34 for releasing in the Google Play Store. We expect Target API 34 to come in August 2024. The current requirement is 33.
Android devices running Android 14 will still be able to run your application even if you target 33. We expect consumer devices to start getting Android 14 towards the end of September.
From official docs*:*
Starting August 31, 2023:
- New apps must target Android 13 (API level 33) or higher; except for Wear OS apps, which must target Android 11 (API level 30) or up to Android 13 (API level 33).
- Existing apps must target API level 31 or above to remain available to users on devices running Android OS higher than your app’s target API level. Apps that target API level 30 or below (target API level 29 or below for Wear OS), will only be available on devices running Android OS same or lower than your apps’ target API level.
Hope the above clarifies there is no pressing requirement for 34.
That being said - our team is looking into how LTS Unity versions behave when targeting the new OS. We are aware of some issues around 2021 LTS that we are investigating.
If you keep encountering this problem when building with a supported Unity LTS please send us a small project with reproduction steps.
Thank you
Hello,
New project with Unity 2021.3.31 has this error after installing OneSignal from here: https://github.com/OneSignal/OneSignal-Unity-SDK/releases/download/3.0.11/OneSignal-v3.0.11.unitypackage
(Releases · OneSignal/OneSignal-Unity-SDK · GitHub)
Run all steps from Setup window.
Run step 5 from here: Unity SDK Setup.
Error after build for Android:
“This project uses AndroidX dependencies, but the ‘android.useAndroidX’ property is not enabled. Set this property to true in the gradle.properties file and retry.”
Adding “android.useAndroidX=true” to gradle properties fixes this error.
After that trying to build and it gives the same error:
Note: E:\UnityProjects\Test34\Test34\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
What went wrong:
Execution failed for task ':launcher:processReleaseResources'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
AAPT2 aapt2-4.0.1-6197926-windows Daemon #1: Unexpected error during link, attempting to stop daemon.
This should not happen under normal circumstances, please file an issue if it does.
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 ':launcher:bundleReleaseResources'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
AAPT2 aapt2-4.0.1-6197926-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.
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.
==============================================================================
Get more help at https://help.gradle.org
BUILD FAILED in 27s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Getting this error in unity when build for Target API level is 34.
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.DefaultCompany.SdkXUnityProject/com.unity3d.player.UnityPlayerActivity}: java.lang.SecurityException: com.DefaultCompany.SdkXUnityProject: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3802)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3942)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2448)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:205)
at android.os.Looper.loop(Looper.java:294)
at android.app.ActivityThread.main(ActivityThread.java:8194)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
That’s a known issue, fix is being worked on. Switching target API to 33 should help you workaround that issue for now
We currently have registered test devices running on Android 14 and cannot gain access to builds due to lack of support for that API.
Do you know if this will be expedited because August 24 is long wait to support existing users with that version of Android? Or is there any support coming for work arounds?
Hi, I have a question, Can you spare some of your time to answer?
[ Can Android 14 OS users run Android 13 Targeted app? ]
I recently updated my app on the google play store with [ Targeting 14 (somehow without errors on building into it) ]
but Android 14 Users are getting 99% Crash on start up.
Will this issue be solved by targeting 13 (Lv.33) ?
I don’t have Android 14 Device so I tested with emulated 14 version in Android Studio and Run the Android version 13 targeted version. It crash the emulated device itself on start up… (btw my unity version is 2022.3.13f.)
Followings are crash log from google play console. (In Production, Running targeting A14 on A14 users)
Exception java.lang.NoClassDefFoundError: Failed resolution of: Lcom/liapp/y;
at com.unity3d.player.UnityPlayerActivity.onCreate
at android.app.Activity.performCreate (Activity.java:8944)
at android.app.Activity.performCreate (Activity.java:8913)
at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1456)
at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:4146)
at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:4322)
at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:103)
at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:139)
at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:96)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2685)
at android.os.Handler.dispatchMessage (Handler.java:106)
at android.os.Looper.loopOnce (Looper.java:230)
at android.os.Looper.loop (Looper.java:319)
at android.app.ActivityThread.main (ActivityThread.java:8893)
at java.lang.reflect.Method.invoke
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:608)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1103)
Can anyone help me on this matter?
Do I have to wait until unity Officially Support A14 in order to allow A14 users to play my game?
Might be connected…
I think its [ LTS 2022 problem ]
I’m going back to 2021.
SIGH.
You don’t need to target API 34 to run on Android 14. Apps targeting API 33 can run on Android 14 just fine
Please communicate somewhere clearly (as in, in the docs maybe?) what API versions are properly supported by Unity so we know what to use to build our games.
Because, sure, API 34 is not a requirement now, but me and others, saw the possibility of building for 34 and thought “hey, maybe I can get ahead of the requirement for next year” and built with 34, got a bunch of bad reviews because the game wasn’t working properly on many devices and then rebuilt with 33.
And after all that, seeing Unity people on the forums nonchalantly state that we shouldn’t be building with 34, but also there is no highest compatible API level because Unity supports 22 and up, is a bit of a slap in the face.
We’re here on 2022.3.20f1 and this is still an issue in March.
Please show some logs, because Unity fixed this issue internally, but multiple places (from packages, plugins) can exhibit the same symptoms, only by seeing the logs, we can tell where the issue comes from.
Hey folks,
To clarify API 34 targeting is supported. You should be able to target API 34 with the versions of the 2021/2022 LTS/Unity 6 released after January 2024 as they contain related improvements.
Android 14 brought a behaviour change regarding broadcast receivers
Multiple plugins (also outside Unity) may need to update/get updated to support that.
On the Unity engine side, we needed to update to newer Google Play Asset Delivery library dependencies for the PAD/aab feature. We’ve also landed a number of related fixes in January for other engine-side receivers.
Both of the above are available from 2021.3.34f1/ 2022.3.14f1 so if you are encountering issues please update your editors.
If any more API 34 target issues come up on your updated Unity projects without any third-party plugins please send us a reproduction so we can investigate.
Thank you
Getting this Gradle error when targeting API 34 with Unity 2021.3.34. Both with Unity managed Android SDK and my own. 33 builds fine.
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':launcher:processReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> AAPT2 aapt2-4.0.1-6197926-windows Daemon #1: Unexpected error during link, attempting to stop daemon.
This should not happen under normal circumstances, please file an issue if it does.
* 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 ':launcher:bundleReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> AAPT2 aapt2-4.0.1-6197926-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.
* 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.
==============================================================================
* Get more help at https://help.gradle.org
BUILD FAILED in 4s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
Hi,
I encountered this issue in Unity 2020.3.48 recently. In our project, it’s related to some 3rd party plugins. I changed compileSdkVersion to 33 (while keeping targetSdkVersion 34) in launcher/build.gradle in the exported gradle project and it built successfully. But I have not done enough tests to confirm the runtime behaviour is correct. Maybe you can give it a try.
* What went wrong:
Execution failed for task ':launcher:processReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> AAPT2 aapt2-4.0.1-6197926-windows Daemon #1: Unexpected error during link, attempting to stop daemon.
This should not happen under normal circumstances, please file an issue if it does.
@Tomas1856 @pixelsprite_unity
Has this issue been taken care of from Unity side already? I’m on 2021.3.35 and still facing it. Just need an official confirmation from Unity side so that I can go ahead and look into finding the culprit 3rd party SDK.
I haven’t seen this issue among reported bugs.
I’ve seen some forum posts mentioning similar issue. If I remember correctly it was Facebook SDK related
running into the same problem. i believe that error is a gradle issue, upgrading gradle works as reported by other users. however, unity 2021 only supports java 1.8 and upgrading gradle requires higher version of java.
so does that make it a “unity 2021 does not support sdk 34”?