Skip to content

Fix Android 14+ installation block ("App is too old") - #1878

Closed
Quantumrunner wants to merge 4 commits into
masterfrom
bug/1877AndroidInstallationBlocked
Closed

Quantumrunner wants to merge 4 commits into
masterfrom
bug/1877AndroidInstallationBlocked

Conversation

@Quantumrunner

Copy link
Copy Markdown
Collaborator

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.

#1877

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant