react-native-compressor icon indicating copy to clipboard operation
react-native-compressor copied to clipboard

for this libandroidlame.so 16kb page support required

Open sandeep14 opened this issue 2 months ago • 40 comments

for this libandroidlame.so 16kb page support required

sandeep14 avatar Sep 27 '25 11:09 sandeep14

👋 @sandeep14 Thanks for opening your issue here! If you find this package useful hit the star🌟!

github-actions[bot] avatar Sep 27 '25 11:09 github-actions[bot]

We are experiencing the same issue in our app since we added this package.

mGallee avatar Sep 28 '25 13:09 mGallee

Same problem here

Volps-deliverThat avatar Sep 30 '25 14:09 Volps-deliverThat

Waiting for this too.

nik098 avatar Sep 30 '25 19:09 nik098

+1

jimmywu-boxworks avatar Oct 01 '25 11:10 jimmywu-boxworks

same problem , Waiting for this too.

karanMoontechnolabs avatar Oct 03 '25 11:10 karanMoontechnolabs

Same problem here, waiting for this

AndMorMat avatar Oct 03 '25 12:10 AndMorMat

+1

C0rren avatar Oct 06 '25 07:10 C0rren

I'm also facing the same issue for this libandroidlame.so (16KB warning). Waiting for the solution.

YashCreole avatar Oct 07 '25 11:10 YashCreole

+1

LCseniordev avatar Oct 08 '25 07:10 LCseniordev

+1

hashhirr avatar Oct 08 '25 11:10 hashhirr

Hey, Guys

I found the solution of this. Go to the below path.

node_modules/react-native-compressor/android/build.gradle

And Search for the line implementation 'com.github.banketree:AndroidLame-kotlin:v0.0.1'

And Replace it with the line implementation 'com.github.kaushik-naik:TAndroidLame:277c2ab4b0'

after this save the file and apply patch of that file with below command.

npx patch-package react-native-compressor

YashCreole avatar Oct 08 '25 11:10 YashCreole

@YashCreole - Can I replace the implementation 'com.github.banketree:AndroidLame-kotlin:v0.0.1' with implementation 'com.github.kaushik-naik:TAndroidLame:277c2ab4b0'. in node_modules>react-native-compressor>android>build.gradle?

Can I skip installing the npx patch-package react-native-compressor because I am a single developer working on my app?

Or I need to install the npx patch-package react-native-compressor?

gkasireddy202 avatar Oct 13 '25 06:10 gkasireddy202

Hi, @gkasireddy202

Yes you're right. You need to change that implementation ... line and after that check in your package.json file that you've the patch-package installed or not. If not then first install the patch package from npm and then apply the patch like this in you project's root foder's terminal with below command.

npx patch-package react-native-compressor

Thank you.

YashCreole avatar Oct 13 '25 07:10 YashCreole

@YashCreole - Thanks for your reply.

I have already installed version v1.13.0 in my project.

Can I proceed with this step in my project?

  1. Replace the implementation 'com.github.banketree:AndroidLame-kotlin:v0.0.1' with implementation 'com.github.kaushik-naik:TAndroidLame:277c2ab4b0'. in node_modules>react-native-compressor>android>build.gradle.

  2. Can I skip installing the npx patch-package react-native-compressor (no need to install this), right?

gkasireddy202 avatar Oct 13 '25 07:10 gkasireddy202

@gkasireddy202

This line npx patch-package react-native-compressor add the permenent patch to that line. If you don't run this command after replacing the implementation .. line then you need to change this every time when you install node_modules.

So the thing is if you npx patch-package react-native-compressor run this then it will automatically apply patch when you will install node_modules.

Thank you

YashCreole avatar Oct 13 '25 07:10 YashCreole

@YashCreole - I am trying to build my app on the 16KB emulator and getting the following error.

error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installRelease -PreactNativeDevServerPort=8081 The NODE_ENV environment variable is required but was not specified. Ensure the project is bundled with Expo CLI or NODE_ENV is set. Using only .env.local and .env D:\My Project\MyApp\android\app\src\main\AndroidManifest.xml:30:9-36 Error: Attribute application@allowBackup value=(false) from AndroidManifest.xml:30:9-36 is also present at [com.github.kaushik-naik:TAndroidLame:277c2ab4b0] AndroidManifest.xml:8:9-35 value=(true). Suggestion: add 'tools:replace="android:allowBackup"' to element at AndroidManifest.xml:26:5-65:19 to override. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:processReleaseMainManifest'. > Manifest merger failed : Attribute application@allowBackup value=(false) from AndroidManifest.xml:30:9-36 is also present at [com.github.kaushik-naik:TAndroidLame:277c2ab4b0] AndroidManifest.xml:8:9-35 value=(true). Suggestion: add 'tools:replace="android:allowBackup"' to element at AndroidManifest.xml:26:5-65:19 to override. * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org./ BUILD FAILED in 22s.

gkasireddy202 avatar Oct 13 '25 11:10 gkasireddy202

This patch works for me. Also if you got Manifest merger failed error then add 'tools:replace="android:allowBackup"' to element at AndroidManifest.xml

react-native-compressor+1.10.4.patch

diff --git a/node_modules/react-native-compressor/android/build.gradle b/node_modules/react-native-compressor/android/build.gradle
index 5071139..96b887a 100644
--- a/node_modules/react-native-compressor/android/build.gradle
+++ b/node_modules/react-native-compressor/android/build.gradle
@@ -115,7 +115,7 @@ dependencies {
   implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4"
   implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4"
   implementation 'org.mp4parser:isoparser:1.9.56'
-  implementation 'com.github.banketree:AndroidLame-kotlin:v0.0.1'
+  implementation 'com.github.kaushik-naik:TAndroidLame:277c2ab4b0'
   implementation 'javazoom:jlayer:1.0.1'
 }

prakashpro3 avatar Oct 14 '25 07:10 prakashpro3

Android build failed when android:allowBackup="false"

gkasireddy202 avatar Oct 14 '25 08:10 gkasireddy202

Instead of patches can this lib be updated with the fix & new ver?

nik098 avatar Oct 14 '25 08:10 nik098

Android build failed when android:allowBackup="false"

if you got Manifest merger failed error then add 'tools:replace="android:allowBackup"' to element at AndroidManifest.xml

prakashpro3 avatar Oct 14 '25 10:10 prakashpro3

Android build failed when android:allowBackup="false"

if you got Manifest merger failed error then add 'tools:replace="android:allowBackup"' to element at AndroidManifest.xml

But I need to set android:allowBackup="false" for my app.

gkasireddy202 avatar Oct 14 '25 10:10 gkasireddy202

Android build failed when android:allowBackup="false"

if you got Manifest merger failed error then add 'tools:replace="android:allowBackup"' to element at AndroidManifest.xml

But I need to set android:allowBackup="false" for my app.

The attribute android:allowBackup is deprecated from Android 12 and higher and may be removed in future versions. Consider adding the attribute android:dataExtractionRules specifying an @xml resource which configures cloud backups and device transfers on Android 12 and higher.

prakashpro3 avatar Oct 14 '25 10:10 prakashpro3

Android build failed when android:allowBackup="false"

if you got Manifest merger failed error then add 'tools:replace="android:allowBackup"' to element at AndroidManifest.xml

But I need to set android:allowBackup="false" for my app.

The attribute android:allowBackup is deprecated from Android 12 and higher and may be removed in future versions. Consider adding the attribute android:dataExtractionRules specifying an @xml resource which configures cloud backups and device transfers on Android 12 and higher.

I added the below in my app/android/app/buidl.gradle. Is this worked?

packagingOptions { // Add these lines to handle 16KB page size issue jniLibs { useLegacyPackaging = true }

    // Exclude problematic libraries if needed
    exclude "lib/x86_64/libandroidlame.so"
}

gkasireddy202 avatar Oct 14 '25 10:10 gkasireddy202

Android build failed when android:allowBackup="false"

if you got Manifest merger failed error then add 'tools:replace="android:allowBackup"' to element at AndroidManifest.xml

But I need to set android:allowBackup="false" for my app.

The attribute android:allowBackup is deprecated from Android 12 and higher and may be removed in future versions. Consider adding the attribute android:dataExtractionRules specifying an @xml resource which configures cloud backups and device transfers on Android 12 and higher.

I added the below in my app/android/app/buidl.gradle. Is this worked?

packagingOptions { // Add these lines to handle 16KB page size issue jniLibs { useLegacyPackaging = true }

    // Exclude problematic libraries if needed
    exclude "lib/x86_64/libandroidlame.so"
}

If you are not compressing audio file then it will works.

prakashpro3 avatar Oct 14 '25 10:10 prakashpro3

Android build failed when android:allowBackup="false"

if you got Manifest merger failed error then add 'tools:replace="android:allowBackup"' to element at AndroidManifest.xml

But I need to set android:allowBackup="false" for my app.

The attribute android:allowBackup is deprecated from Android 12 and higher and may be removed in future versions. Consider adding the attribute android:dataExtractionRules specifying an @xml resource which configures cloud backups and device transfers on Android 12 and higher.

I added the below in my app/android/app/buidl.gradle. Is this worked? packagingOptions { // Add these lines to handle 16KB page size issue jniLibs { useLegacyPackaging = true }

    // Exclude problematic libraries if needed
    exclude "lib/x86_64/libandroidlame.so"
}

If you are not compressing audio file then it will works.

I am using react-native-compressor for reducing the image in my app. The 16KB warning pop-up has disappeared after I added this code to my project. Can I proceed to upload my AAB to the Google Play Store? Can Google Play Store approve my app? buildToolsVersion = "35.0.0" minSdkVersion = 24 compileSdkVersion = 35 targetSdkVersion = 35 ndkVersion = "27.1.12297006" kotlinVersion = "2.0.21

gkasireddy202 avatar Oct 14 '25 10:10 gkasireddy202

Android build failed when android:allowBackup="false"

if you got Manifest merger failed error then add 'tools:replace="android:allowBackup"' to element at AndroidManifest.xml

But I need to set android:allowBackup="false" for my app.

The attribute android:allowBackup is deprecated from Android 12 and higher and may be removed in future versions. Consider adding the attribute android:dataExtractionRules specifying an @xml resource which configures cloud backups and device transfers on Android 12 and higher.

I fixed this issue by adding this line in the Manifest: android:allowBackup="false" android:dataExtractionRules="@xml/data_extraction_rules" tools:replace="android:allowBackup" Is this correct?

gkasireddy202 avatar Oct 16 '25 03:10 gkasireddy202

Since I use the package only for image compression, adding this to app/build.gradle helped to comply with 16KB page size requirement.

configurations.all {
    exclude group: 'com.github.banketree', module: 'AndroidLame-kotlin'
}

However, updating the package would be a better solution than exclusions or patched. Looking forward to new updated version :)

aliravn avatar Oct 16 '25 09:10 aliravn

Hey, Guys

I found the solution of this. Go to the below path.

node_modules/react-native-compressor/android/build.gradle

And Search for the line implementation 'com.github.banketree:AndroidLame-kotlin:v0.0.1'

And Replace it with the line implementation 'com.github.kaushik-naik:TAndroidLame:277c2ab4b0'

after this save the file and apply patch of that file with below command.

npx patch-package react-native-compressor

I will plan to push the app to the Google Play Store. Can you please let me know if this Does not support 16 KB warning disappears from the Google Play Console after these changes are pushed to the Google Play Store?

gkasireddy202 avatar Oct 17 '25 12:10 gkasireddy202

Hello guys! For Expo project add this into app.json/plugins

[ "expo-build-properties", { "android": { "buildArchs": ["arm64-v8a", "armeabi-v7a"], } ],

Thank me later!

AndrianarivoAlpha avatar Oct 21 '25 11:10 AndrianarivoAlpha