Search code examples
androidwindowsunity-game-enginegradleandroid-unity-plugin

Android build issue in Unity 2022 LTS (2022.3.9f1) but working fine in Unity 2023 Tech Stream


Can anyone please help understand why Android builds might run fine in Unity 2023 Tech Stream, but not run with the error below (plus a few others, but this appears first in the stack) in Unity 2022 LTS!?

Exception while marshalling <many_files> Probably the SDK is read-only

Troubleshooting (Windows 10):

  • Going into build settings -> player settings, and changing the minimum api level from 5 to 6.

  • Checked and unchecked development build in build settings.

  • Tried moving the whole project to the C drive and running from there, as 2022 appeared to default new projects to being saved on the D drive.

  • Installed the latest 2022 LTS (2022.3.9f1) version of Unity (the prior version to this was one or two LTS versions before the 2022.3.9f1 LTS version). Simple build (no content) failed from D or C drive.


Solution

  • Pointing the Unity editor SDK path in 2022 LTS (2022.3.9f1) to the SDK path in the installed 2023 Tech Stream (2023.1.5f1) version of the Unity editor fixed all errors.