react-native-menu / menu

UIMenu Component for React Native
MIT License
908 stars 51 forks source link

Test build fails on react-native@0.74 due to minSdkVersion 21 #802

Open lluiscab opened 1 month ago

lluiscab commented 1 month ago

react-native@0.74 bumped the minSdkVersion to 23 (see release notes)

This library is still using minSdkVersion 21 as seen in: https://github.com/react-native-menu/menu/blob/5f47a7ff874f9b4474a32fef7a68bdf6d5fb7409/android/gradle.properties#L2 and https://github.com/react-native-menu/menu/blob/5f47a7ff874f9b4474a32fef7a68bdf6d5fb7409/android/build.gradle#L59 which is causing build issues on my project when building the app for testing.

Build error:

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-menu_menu:processDebugAndroidTestManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 21 cannot be smaller than version 23 declared in library [com.facebook.react:react-android:0.74.1] /<redacted>/.gradle/caches/transforms-4/e5b57f16c7e0461b8ffc655e3c736199/transformed/jetified-react-android-0.74.1-debug/AndroidManifest.xml as the library might be using APIs not available in 21
    Suggestion: use a compatible library with a minSdk of at most 21,
        or increase this project's minSdk version to at least 23,
        or use tools:overrideLibrary="com.facebook.react" to force usage (may lead to runtime failures)
zxcodes commented 1 month ago

Same here. The build fails after upgrading to Expo SDK 51. I have the exact same error.

lluiscab commented 1 month ago

Any progress on this issue? I seems like it's the only thing left blocking our update to react-native@0.74. If the only required changes are updating the minSdkVersion in build.gradle and gradle.properties, then I might have time to open a PR myself, but I'm not sure if those are the only required changes

zxcodes commented 1 month ago

Any progress on this issue? I seems like it's the only thing left blocking our update to react-native@0.74. If the only required changes are updating the minSdkVersion in build.gradle and gradle.properties, then I might have time to open a PR myself, but I'm not sure if those are the only required changes

IMO, those are the only changes that you need to make. I'm currently using a fork of this library with those changes. I'm not sure if a PR for that would be considered since it might be a breaking change for the apps that target a lower SDK version.

lluiscab commented 1 month ago

I'm not sure if a PR for that would be considered since it might be a breaking change for the apps that target a lower SDK version.

Given that react-native@0.74 already bumps minSdkVersion to 23, I'd say that it's not that much of a problem, in any case he change could be published as a major release.

zxcodes commented 1 month ago

I'm not sure if a PR for that would be considered since it might be a breaking change for the apps that target a lower SDK version.

Given that react-native@0.74 already bumps minSdkVersion to 23, I'd say that it's not that much of a problem, in any case he change could be published as a major release.

Cool. A PR should do the job then.