Android 14 (API Level 34) in Unity 2020 LTS and 2021 LTS

Hi,

Is Android 14 supported as a build target in Unity 2020 and 2021 ?

I have tried building an empty project in Unity 2020.3.30f1 and Unity 2021.3.32f1 targeting Android API level 34. Both builds can be installed on an Android 14 device, but crash immediately when opened. There are no errors or stacktrace logged, only "D Unity : CommandLine: ".

The same project in Unity 2022.3.13f1 does run without issue.
In each test used the unity-provided Android SDK+NDK and OpenJDK.

Is there a way of making this work in Unity 2020 ? For context, our game is currently using version 2020.3.30f1, and upgrading to a more recent version of the editor is a significant amount of work for our team as we have developed a number of tools and dependencies that would need to be updated.

9470909–1331096–EmptyProject.zip (19.2 KB)

Share the built apk to have a look.

Sure, here are the APKs built in Unity 2022 and 2020 respectively: Build_2022.apk, Build_2020.apk.

Im using 2022.3.14f1 and Im facing the same issue when installing the APK on an android 14 device

Any updates on this? We’re noticing our 2020.3.34 android apps have been exhibiting startup crashes on Android 14 devices

We solved this issued by settings the target SDK level to 33. This does not break compatibility with android 14.

Unity has bugs with SDK 34 even though frustratingly there isn’t a clear document somewhere telling us what SDKs are compatible with Unity or not.

Since Unity is dragging their feet with matters like this one, expect Unity to work “okay-ish” with SDK 34 after Google makes it a requirement, not before.

Unity 2020 is no longer supported, please switch to more recent supported LTS.

Couldn’t the crash happen for this reason:

?
Quoting:
“All cases of broadcast receivers being registered within Unity code have been fixed or handled
If anyone is still able to reproduce in a project without any third-party libraries or plugins, we will be able to investigate further”
Please can someone more skilled than me in Android gruesome details tell me what I should do?
The link in the issue tracker send me to code that doesn’t make any sense to me. Where should I write this? I use some plugins, do I have to unpack them? No clue.

Did you try updating Unity to one of the versions it was fixed “Fixed in 2021.3.33f1, 2022.3.13f1, 2023.1.20f1, 2023.3.0a11”, and see if that fixes the crash?

Not yet, I read this forum post:
https://discussions.unity.com/t/937436
And I’m very afraid to update because I use Google Play with their plugin and I fear creating problems for the hundreds of users who already have it.

Moreover a few users commented on the bug fix like this: ‘Still happening on 2021.3.33f1’

I wondered also if this change means every plugin provider should update its plugins and what to do for discontinued ones.

In https://issuetracker.unity3d.com/issues/android-targetapi-34-crash-on-launch case, the issue with broadcast receivers was fixed in Unity core, if any plugins out there had bad broadcast receiver code on their end, then those plugins need to fix that on their end. It all depends on from where the issue originates.

I’m having the least problem, Android 14 doesn’t work in my apps, my unity is v 2021.3.32f1, I tried it in 2022 lts and 2021.3.35

As stated in https://issuetracker.unity3d.com/issues/android-targetapi-34-crash-on-launch, the fix was done in Unity 2021.3.33f1, you must update Unity.

Seems like they tried that.

If that’s the case, most likely it’s a different issue, a bug report would be required. But our QA tested projects against API level 34, and it worked fine.

Saying it’s the same issue without any logs, gives too much room for guessing.

I installed version 2021.3.33f1, I had a problem updating the SDK to 34, I had to copy the files to another repository, after managing to generate the file to publish on the play store the error persisted, Android 14 closes every time I open the game and asks to clear cache.

I don’t know what else to do, I did everything I could, if anyone finds a solution please post it, it will help a lot of people.

6741043--776845--upload_2021-1-19_19-3-0.png

This solution really worked for me. Thanks for sharing it. I was using Unity 2021.3.33f1

Hey folks, please send reproduction projects so we can investigate any issues.

We’ve updated Unity versions in the last months (from 2021+) as Tomas states above to make them compatible with API 34. Third-party plugins may need to do some work on their end as well.

Targeting API 33 is a temporary solution.

If you are targetting the Google Play Store, usually Google requires that new & updated apps target the latest API by August of next year since the API release. This means that API 34 will very likely be required to submit updates post-August 2024. Last year an extension was granted to November 2023. Google has not yet announced this year’s deadlines.

Same problem here

Execution failed for task ‘:launcher:bundleReleaseResources’.

A failure occurred while executing com.android.build.gradle.internal.res.Aapt2ProcessResourcesRunnable
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.

Using Unity 2021.3.38