The error you're encountering, INSTALL_FAILED_INTERNAL_ERROR: Failed to extract native libraries, res=-110 and INSTALL_FAILED_INVALID_APK: Failed to extract native libraries, res=-2, is directly related to the alignment and structure of your modified config.arm64_v8a.apk. The key log line is:
textE NativeLibraryHelper: extractNativeLibs=false library 'libmegazord.so' is not PAGE(4096)-aligned within apk (APK alignment, not ELF alignment) - will not be able to open it directly from apk.
config.arm64_v8a.apk) to be 4KB (4096-byte) aligned for native libraries (.so files) to be extracted and loaded correctly.zipalign -v 4 command aligns the APK, but if the native libraries inside the APK are not properly aligned or the APK itself is not correctly structured after modification, this error occurs.libmegazord.so is not page-aligned within the APK.install-multiple, all split APKs must be properly aligned and signed with the same key.base.apk and config.arm64_v8a.apk are not signed with the same key, or if the alignment is broken, the installer will fail.config.arm64_v8a.apk (especially if it affects the lib/ directory or the APK's internal structure) can break the alignment or the expected layout.apktool b, always run zipalign -v 4 on the output APK.If this fails, re-align the APK.bashzipalign -c -v 4 config.arm64_v8a/dist/config.arm64_v8a_aligned.apk
base.apk, config.arm64_v8a.apk, config.xxhdpi.apk) must be signed with the same key.bashapksigner sign --ks mykey.jks --ks-key-alias myalias --out base_signed.apk base.apk apksigner sign --ks mykey.jks --ks-key-alias myalias --out config.arm64_v8a_signed.apk config.arm64_v8a/dist/config.arm64_v8a_aligned.apk apksigner sign --ks mykey.jks --ks-key-alias myalias --out config.xxhdpi_signed.apk config.xxhdpi.apk
bashadb install-multiple base_signed.apk config.arm64_v8a_signed.apk config.xxhdpi_signed.apk
libmegazord.so is not page-aligned within the APK.lib/ directory in the APK is correctly structured and that the .so files are not corrupted.If thebashunzip -l config.arm64_v8a/dist/config.arm64_v8a_aligned.apk | grep lib/
.so files are missing or misplaced, the rebuild process may have failed.apktool Correctlyapktool b, use the --use-aapt2 flag (if available) for better compatibility:
bashapktool b --use-aapt2 config.arm64_v8a -o config.arm64_v8a_rebuilt.apk
aapt or apktool to dump the APK and check for issues:
Look for warnings or errors.bashaapt dump badging config.arm64_v8a/dist/config.arm64_v8a_aligned.apk
bash# Rebuild apktool b --use-aapt2 config.arm64_v8a -o config.arm64_v8a_rebuilt.apk # Align zipalign -v 4 config.arm64_v8a_rebuilt.apk config.arm64_v8a_aligned.apk # Sign all split APKs with the same key apksigner sign --ks mykey.jks --ks-key-alias myalias --out base_signed.apk base.apk apksigner sign --ks mykey.jks --ks-key-alias myalias --out config.arm64_v8a_signed.apk config.arm64_v8a_aligned.apk apksigner sign --ks mykey.jks --ks-key-alias myalias --out config.xxhdpi_signed.apk config.xxhdpi.apk # Install adb install-multiple base_signed.apk config.arm64_v8a_signed.apk config.xxhdpi_signed.apk
apktool handles split APKs.bundletool (for Android App Bundles) or manually repack the APKs with zip and signapk for more control.base.apk instead of the split APK, if possible.Vibe can make mistakes. Check answers. Learn more