Fix Android 14+ installation block ("App is too old") - #1878
Closed
Quantumrunner wants to merge 4 commits into
Closed
Quantumrunner wants to merge 4 commits into
Quantumrunner wants to merge 4 commits into
Conversation
Starting with Android 14, the OS blocks the installation of any app targeting an SDK level below 28. This commit updates the target SDK to API 34 (Android 14) to resolve the installation block on modern Android devices. Changes: - Updated `targetSdkVersion` to 34 and `minSdkVersion` to 19 in `AndroidManifest.xml` to reflect current requirements. - Updated `AndroidTargetSdkVersion` from 29 to 34 in Unity `ProjectSettings.asset` to ensure the final build targets the correct API level.
When upgrading the target SDK to API 31 (Android 12) or higher, Android strictly enforces that any Activity, Service, or Receiver declaring an <intent-filter> must explicitly specify the `android:exported` attribute. Failure to do so results in an "Invalid package" error during installation. Changes: - Added `android:exported="true"` to `UnityPlayerActivity` in `AndroidManifest.xml` to comply with modern Android security requirements and allow the APK to install successfully.
…exported attributes Upgrading the target SDK to 34 triggered two strict installation requirements
on modern Android devices which caused "Invalid package" errors:
1. Android 12+ requires `android:exported` to be explicitly declared on any
component using an intent filter. Older plugins (Firebase, Play Services)
omitted this.
- Added `FixExportedManifest.cs` Editor script to automatically inject
`android:exported="true"` into the final merged AndroidManifest.xml
during the build process.
2. Android 11+ requires APKs to be signed with the APK Signature Scheme v2.
The previous build script used `jarsigner`, which only applies a v1 signature.
- Replaced `jarsigner` with `apksigner` in `build.ps1` to ensure the APK
receives the mandatory v2 signature.
- Reordered `zipalign` to run before `apksigner`, as required by v2 signing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Starting with Android 14, the OS blocks the installation of any app targeting an SDK level below 28. This commit updates the target SDK to API 34 (Android 14) to resolve the installation block on modern Android devices.
Changes:
targetSdkVersionto 34 andminSdkVersionto 19 inAndroidManifest.xmlto reflect current requirements.AndroidTargetSdkVersionfrom 29 to 34 in UnityProjectSettings.assetto ensure the final build targets the correct API level.#1877