Remove the option to compress Android native libraries

Follow-up to https://github.com/godotengine/godot/pull/106358, this is a separate commit / PR since it shouldn't be cherry-picked in previous releases as it removes existing functionality.

Support for 16kb page size added in the previous PR requires the native libraries to be uncompressed, so we're deprecating and removing the option to compress native libraries.
See https://developer.android.com/guide/practices/page-sizes#agp_version_851_or_higher for more details.
This commit is contained in:
Fredia Huya-Kouadio 2025-05-13 08:48:03 -07:00
parent 5e27318b6c
commit e3d60bbd0c
4 changed files with 0 additions and 38 deletions

View file

@ -132,14 +132,6 @@ android {
doNotStrip '**/*.so'
}
jniLibs {
// Setting this to true causes AGP to package compressed native libraries when building the app
// For more background, see:
// - https://developer.android.com/build/releases/past-releases/agp-3-6-0-release-notes#extractNativeLibs
// - https://stackoverflow.com/a/44704840
useLegacyPackaging shouldUseLegacyPackaging()
}
// Always select Godot's version of libc++_shared.so in case deps have their own
pickFirst 'lib/x86/libc++_shared.so'
pickFirst 'lib/x86_64/libc++_shared.so'

View file

@ -375,24 +375,6 @@ ext.shouldNotStrip = { ->
return isAndroidStudio() || project.hasProperty("doNotStrip")
}
/**
* Whether to use the legacy convention of compressing all .so files in the APK.
*
* For more background, see:
* - https://developer.android.com/build/releases/past-releases/agp-3-6-0-release-notes#extractNativeLibs
* - https://stackoverflow.com/a/44704840
*/
ext.shouldUseLegacyPackaging = { ->
int minSdk = getExportMinSdkVersion()
String legacyPackagingFlag = project.hasProperty("compress_native_libraries") ? project.property("compress_native_libraries") : ""
if (legacyPackagingFlag != null && !legacyPackagingFlag.isEmpty()) {
return Boolean.parseBoolean(legacyPackagingFlag)
}
// Default behavior for minSdk >= 24
return false
}
ext.getAddonsDirectory = { ->
String addonsDirectory = project.hasProperty("addons_directory") ? project.property("addons_directory") : ""
return addonsDirectory