not compatible with expo52
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':app:processDebugMainManifest'.
Manifest merger failed with multiple errors, see logs
- 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.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.10.2/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD FAILED in 7s 316 actionable tasks: 61 executed, 237 from cache, 18 up-to-date Error: /Users/tadejhiti/Documents/klikni/klikni-partner/android/gradlew app:assembleDebug -x lint -x test --configure-on-demand --build-cache -PreactNativeDevServerPort=8081 -PreactNativeArchitectures=arm64-v8a,armeabi-v7a exited with non-zero code: 1
I saw #543 but it has not been merged into release yet, so I would wish to know, if we have to change the whole library or wait for you to release the new version, because it is still not working..?
Inside buid.gradle (app) , add this
android{ .... // Configure configurations to handle dependency conflicts configurations.all { resolutionStrategy { force "androidx.core:core:1.13.1" force "androidx.versionedparcelable:versionedparcelable:1.1.1" force 'androidx.appcompat:appcompat:1.6.1' // Ensure consistent AndroidX versions force 'androidx.fragment:fragment:1.6.2' // Ensure consistent AndroidX versions
// Exclude all modules from the old support library group.
// Jetifier should handle migrating usages to AndroidX.
exclude group: 'com.android.support'
}
}
} .... }
If you're using Expo/EAS builds, you can create a plugin using @expo/config-plugins
- create
withAndroidResolutionStrategy.jsin your app's root folder:
const { withAppBuildGradle } = require('@expo/config-plugins');
/**
* A config plugin that adds a resolutionStrategy to resolve Android dependency conflicts
*/
module.exports = function withAndroidResolutionStrategy(config) {
return withAppBuildGradle(config, config => {
// Check if the build.gradle content already contains our resolution strategy to avoid duplication
if (config.modResults.contents.includes('// CUSTOM RESOLUTION STRATEGY')) {
return config;
}
// Define the code block we want to add
const resolutionStrategyBlock = `
// CUSTOM RESOLUTION STRATEGY
configurations.all {
resolutionStrategy {
force "androidx.core:core:1.13.1"
force "androidx.versionedparcelable:versionedparcelable:1.1.1"
force 'androidx.appcompat:appcompat:1.6.1' // Ensure consistent AndroidX versions
force 'androidx.fragment:fragment:1.6.2' // Ensure consistent AndroidX versions
// Exclude all modules from the old support library group.
// Jetifier should handle migrating usages to AndroidX.
exclude group: 'com.android.support'
}
}`;
// Look for the android { block to insert our code inside it
const androidBlockRegex = /android\s*\{/;
// Insert our resolution strategy block right after the android { opening
if (androidBlockRegex.test(config.modResults.contents)) {
config.modResults.contents = config.modResults.contents.replace(
androidBlockRegex,
`android {${resolutionStrategyBlock}`,
);
}
return config;
});
};
- then add the plugin to your
app.jsonplugins:
expo: {
name: "YourAppName",
// ... your existing config
plugins: [
// ... your existing plugins
"./withAndroidResolutionStrategy"
],
}