itinance / react-native-sha256

sha256 natively for react-native
MIT License
99 stars 50 forks source link

Android build fails for AndroidTest with minSdkVersion 17 with react-native 0.64 #36

Closed Merlier closed 1 year ago

Merlier commented 3 years ago

I'm using Detox for e2e tests and after upgrading to RN 0.64, the app detox build fails. This issue could concern multiple modules. It's referenced here: https://github.com/wix/Detox/issues/2712

The following command fails after upgrading to RN 0.64 ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug

With the following message: `

Task :react-native-sha256:processDebugAndroidTestManifest FAILED [androidx.vectordrawable:vectordrawable-animated:1.0.0] /root/.gradle/caches/transforms-2/files-2.1/bb05b16f135343eba8fb88851c1f8ee9/vectordrawable-animated-1.0.0/AndroidManifest.xml Warning: Package name 'androidx.vectordrawable' used in: androidx.vectordrawable:vectordrawable-animated:1.0.0, androidx.vectordrawable:vectordrawable:1.0.1. See http://g.co/androidstudio/manifest-merger for more information about the manifest merger. /builds/application-mobile/node_modules/react-native-sha256/android/build/intermediates/tmp/manifest/androidTest/debug/manifestMerger1695351036710269372.xml:5:5-74 Error: uses-sdk:minSdkVersion 16 cannot be smaller than version 21 declared in library [com.facebook.react:react-native:0.64.2] /root/.gradle/caches/transforms-2/files-2.1/83fdc6c83523d4af6406d02587819ec5/jetified-react-native-0.64.2/AndroidManifest.xml as the library might be using APIs not available in 16 Suggestion: use a compatible library with a minSdk of at most 16, or increase this project's minSdk version to at least 21, or use tools:overrideLibrary="com.facebook.react" to force usage (may lead to runtime failures) `

I looked for several solutions but the easiest would be to update the gradle android config of react-native-sha256, inspired from other gradle file of module like: https://github.com/react-native-async-storage/async-storage/blob/master/android/build.gradle