Build Error: SDK is Read Only

When compiling to Android, Unity fails with the following error:

Exception while marshalling C:\Program Files\Unity\Hub\Editor\2023.2.20f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\32.0.0\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2023.2.20f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2023.2.20f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-31\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2023.2.20f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-33\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2023.2.20f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2023.2.20f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\32.0.0\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2023.2.20f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2023.2.20f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-31\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2023.2.20f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-33\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2023.2.20f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only

After this occurred, I refreshed the project, rebuilt the Library, and completely uninstalled Unity and reinstalled it. None of these efforts has fixed the issue.

The file in question, ‘package.xml’, doesn’t exist. The path exists, but the file is nowhere to be found. The path itself has full R/W permissions from my user account, and the SDK was freshly installed with my new Unity install.

Any other suggestions as to why this is happening?

Those are not errors, please attach Editor.log

Editor.txt (82.8 KB)

Attached full Editor.txt

Your error is

* What went wrong:
Execution failed for task ':launcher:compressDebugAssets'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CompressAssetsWorkAction
   > Required array size too large

check launcher/build.gradle and unityLibrary/build.gradle files, there’s a property noCompress, I think it contains too many values.

The gradle project is in C:/Users/mohxg/Documents/GitHub/EnginePolystreamConcept/EnginePolystreamConcept/Library/Bee/Android/Prj/IL2CPP/Gradle

launcher/build.gradle:

noCompress = ['.unity3d', '.ress', '.resource', '.obb', '.bundle', '.unityexp'] + unityStreamingAssets.tokenize(', ')

unityLibrary/build.gradle:

noCompress = ['.unity3d', '.ress', '.resource', '.obb', '.bundle', '.unityexp'] + unityStreamingAssets.tokenize(', ')

check unityStreamingAssets value, I think it’s in gradle.properties

org.gradle.jvmargs = -Xmx2048M
org.gradle.parallel = true
unityStreamingAssets = .onnx, .sentis, .json, .gguf, .txt, .bin
unityTemplateVersion=9
unityProjectPath=C:/Users/mohxg/Documents/GitHub/EnginePolystreamConcept/EnginePolystreamConcept
android.useAndroidX=true
android.enableJetifier=true
org.gradle.welcome=never

This is the gradle.properties

Hmph, maybe its something, theres assets folder in unityLibrary, can you count how many files there are including in assets and its subfolders

Do you want the file total in Assets or in unityLibrary at the path you provided above? There is no directory in unityLibrary called ‘Assets’, just ‘build’, ‘libs’, ‘src’, and ‘symbols’.

assets folder is in src I think

5.81GB, only around 8 files with significant size. They are .onnx and .gguf files (AI models), specifically Whisper, a few LLMs, and some custom models.

Since apk is basically a zip file, I am guessing you might be hitting 4GB limit. You might need to split up your assets, for example use custom asset packs and switch your build to app bundle. You can read more about this here - Unity - Manual: Asset packs in Unity

I’ll give this a try, thank you.