Expo CLI 4.8.1 environment info:
System:
OS: Linux 5.8 KDE neon 5.22
Shell: 5.0.17 - /bin/bash
npmPackages:
expo: ^42.0.0 => 42.0.0
react: ^17.0.1 => 17.0.2
react-dom: ^17.0.1 => 17.0.2
react-native: https://github.com/expo/react-native/archive/sdk-42.0.0.tar.gz => 0.63.2
react-native-web: ~0.15.0 => 0.15.7
Expo Workflow: managed
eas-cli/0.22.0 linux-x64 node-v14.17.3
I’m trying to add react-native-ffmpeg to my project with video-lts packages (LTS use minSdkVersion 16).
How to edit build.gradle to define package name in ext?
Or how to increase minSdkVersion to required level?
import { ExpoConfig, ConfigContext } from '@expo/config';
import { ConfigPlugin, withAppBuildGradle } from '@expo/config-plugins';
const withFfmpegMod: ConfigPlugin = (config) => {
return withAppBuildGradle(config, config => {
config.mods = {
...config.mods,
android: {
appBuildGradle: (config) => {
config.modResults.contents = `ext {
reactNativeFFmpegPackage = "video-lts"
}`;
return config;
},
},
};
return config;
});
};
export default ({ config }: ConfigContext): ExpoConfig => withFfmpegMod(config as ExpoConfig);
"Run gradlew" phase.
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
[stderr] /build/workingdir/build/android/app/src/debug/AndroidManifest.xml Error:
[stderr] uses-sdk:minSdkVersion 21 cannot be smaller than version 24 declared in library [:react-native-ffmpeg] /build/workingdir/build/node_modules/react-native-ffmpeg/android/build/intermediates/library_manifest/debug/AndroidManifest.xml as the library might be using APIs not available in 21
[stderr] Suggestion: use a compatible library with a minSdk of at most 21,
[stderr] or increase this project's minSdk version to at least 24,
[stderr] or use tools:overrideLibrary="com.arthenica.reactnative" to force usage (may lead to runtime failures)
> Task :unimodules-core:compileDebugKotlin
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:processDebugMainManifest'.
[stderr] > Manifest merger failed : uses-sdk:minSdkVersion 21 cannot be smaller than version 24 declared in library [:react-native-ffmpeg] /build/workingdir/build/node_modules/react-native-ffmpeg/android/build/intermediates/library_manifest/debug/AndroidManifest.xml as the library might be using APIs not available in 21
[stderr] Suggestion: use a compatible library with a minSdk of at most 21,
[stderr] or increase this project's minSdk version to at least 24,
[stderr] or use tools:overrideLibrary="com.arthenica.reactnative" to force usage (may lead to runtime failures)
[stderr] * Try:
[stderr] 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.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 2m 1s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.8/userguide/command_line_interface.html#sec:command_line_warnings
429 actionable tasks: 429 executed
Error: Gradle build failed with unknown error. Please see logs for the "Run gradlew" phase.