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

Support 16 KB page sizes

Open Ridwan226 opened this issue 1 month ago • 11 comments

Memory page size Not supported 16 KB Hide details Learn more Libraries that do not support 16 KB: base/lib/x86_64/libandroidlame.so

is this error coming from react native compressor

Ridwan226 avatar Nov 23 '25 05:11 Ridwan226

@numandev1 Any luck on this item ?

till it fixes you can use this expo config plugin should solve the ussue

const { withAppBuildGradle } = require('@expo/config-plugins');

/**
 * Expo config plugin to add Android dependency substitution for AndroidLame library
 * This substitutes the original AndroidLame-kotlin library with a forked version
 */
const withAndroidDependencySubstitution = (config) => {
  return withAppBuildGradle(config, (config) => {
    const { modResults } = config;
    let gradleContent = modResults.contents;

    // Check if the substitution already exists to avoid duplicates
    if (gradleContent.includes('com.github.banketree:AndroidLame-kotlin')) {
      console.log('⚠️  Android dependency substitution already exists, skipping...');
      return config;
    }

    // Find the configurations.all block or create one
    const configurationPattern = /configurations\.all\s*\{[\s\S]*?\n\}/;
    
    const substitutionBlock = `
    resolutionStrategy.dependencySubstitution {
        substitute(module('com.github.banketree:AndroidLame-kotlin'))
                .using(module('com.github.kaushik-naik:TAndroidLame:a485052f28'))
    }`;

    if (configurationPattern.test(gradleContent)) {
      // If configurations.all block exists, add substitution inside it
      gradleContent = gradleContent.replace(
        configurationPattern,
        (match) => {
          // Insert before the closing brace
          return match.replace(/\n\}$/, `${substitutionBlock}\n}`);
        }
      );
      console.log('✅ Added dependency substitution to existing configurations.all block');
    } else {
      // If no configurations.all block exists, create one after dependencies block
      const dependenciesPattern = /(dependencies\s*\{[\s\S]*?\n\})/;
      
      if (dependenciesPattern.test(gradleContent)) {
        gradleContent = gradleContent.replace(
          dependenciesPattern,
          `$1

configurations.all {${substitutionBlock}
}`
        );
        console.log('✅ Created configurations.all block with dependency substitution');
      } else {
        // Fallback: add at the end of the file
        gradleContent += `

configurations.all {${substitutionBlock}
}
`;
        console.log('✅ Added configurations.all block at end of file');
      }
    }

    modResults.contents = gradleContent;
    return config;
  });
};

module.exports = withAndroidDependencySubstitution;

ursnj avatar Nov 23 '25 06:11 ursnj

Same problem, can't publish on Play Store.

kussberg avatar Nov 23 '25 23:11 kussberg

same as here

Doris-belle avatar Nov 24 '25 05:11 Doris-belle

Same problem with expo

Jwmffreitas avatar Nov 24 '25 16:11 Jwmffreitas

Same problem too, does anyone have a solution?

ThomasRibalta avatar Nov 25 '25 14:11 ThomasRibalta

Same problem

omarsukarieh avatar Nov 25 '25 22:11 omarsukarieh

same here

tomerh2001 avatar Nov 26 '25 14:11 tomerh2001

Use the apk analyzer from android studio to check

As u can see the it shows 16Kb alignment.


Image
Image

Check your other dependencies as well You may need to update your react native version as 16Kb page size support was added in v.0.77.0


devAdrish avatar Nov 27 '25 11:11 devAdrish

+1, same problem, cannot push to playstore

Ozaoujal avatar Nov 28 '25 02:11 Ozaoujal

react-native-compressor+1.13.0.patch

patches/react-native-compressor+1.13.0.patch

While I'm doing this

Support for images and videos only

https://pastebin.com/9vykhpPq

Ridwan226 avatar Nov 28 '25 09:11 Ridwan226

react-native-compressor+1.13.0.patch

patches/react-native-compressor+1.13.0.patch

While I'm doing this

Support for images and videos only

https://pastebin.com/9vykhpPq

It worked! thanks

ikbalmoh avatar Nov 29 '25 04:11 ikbalmoh

+1

aravind3566 avatar Dec 15 '25 07:12 aravind3566

@ikbalmoh if this works give me a buymeacoffee link and i`ll hook you up

christian-hess-94 avatar Dec 17 '25 12:12 christian-hess-94

this made it work thank you very much, i`ll wait for the buymeacoffee link

christian-hess-94 avatar Dec 18 '25 16:12 christian-hess-94

I got a different error when going to RN 0.80.2 I did a few modifications to the patch file and it fixed the issue for me.

The main gist (haha, pun) of it is the fact that compressor is using some outdated android SDKs that are no longer available so gradlew fails to compile

https://gist.github.com/christian-hess-94/6a51b3bc1a5fb388c16bda267bc9b0a0

Just replace the patch file for this, it`ll still be 16KB compliant

christian-hess-94 avatar Dec 18 '25 17:12 christian-hess-94