Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Android): minSdkVersion fallback to default 21 but RN 0.74 require minSdkVersion 23 #2346

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

adrianryt
Copy link
Contributor

@adrianryt adrianryt commented Sep 19, 2024

Description

This PR is a potential fix for #2295. Following suggestions in PR#2251 and Android Gradle Plugin version 7.0.0 changes: minSdkVersion was renamed to minSdk, targetSdkVersion was renamed to targetSdk, compileSdkVersion was renamed to compileSdk, this PR ensures compatibility with react native integrated with newest Android projects.

Fixes #2295

Changes

In adroid/build.gradle file to get value for minSdkVersion in defaultConfig it will look for minSdkVersion in rootProject then look for minSdk and then fallback to default. Previously it looked for minSdkVersion and fallback if not found.
Similar logic for targetSdkVersion and compileSdkVersion

Test code and steps to reproduce

Checklist

@adrianryt adrianryt marked this pull request as ready for review September 19, 2024 08:28
Copy link
Member

@kkafar kkafar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!

@adrianryt adrianryt merged commit 98d6ca6 into main Sep 25, 2024
4 checks passed
@adrianryt adrianryt deleted the fix-minSdkVersion-name-change branch September 25, 2024 08:55
ja1ns pushed a commit to WiseOwlTech/react-native-screens that referenced this pull request Oct 9, 2024
…e minSdkVersion 23 (software-mansion#2346)

## Description
This PR is a potential fix for
[software-mansion#2295](software-mansion#2295).
Following suggestions in
[PR#2251](software-mansion#2251 (comment))
and Android Gradle Plugin version 7.0.0 changes: `minSdkVersion` was
renamed to `minSdk`, `targetSdkVersion` was renamed to `targetSdk`,
`compileSdkVersion` was renamed to `compileSdk`, this PR ensures
compatibility with react native integrated with newest Android projects.

Fixes software-mansion#2295

<!--
Description and motivation for this PR.

Include Fixes #<number> if this is fixing some issue.

Fixes # .
-->

## Changes
In `adroid/build.gradle` file to get value for `minSdkVersion` in
`defaultConfig` it will look for `minSdkVersion` in rootProject then
look for `minSdk` and then fallback to default. Previously it looked for
`minSdkVersion` and fallback if not found.
Similar logic for `targetSdkVersion` and `compileSdkVersion`
<!--
Please describe things you've changed here, make a **high level**
overview, if change is simple you can omit this section.

For example:

- Updated `about.md` docs

-->

<!--

## Screenshots / GIFs

Here you can add screenshots / GIFs documenting your change.

You can add before / after section if you're changing some behavior.

### Before

### After

-->

## Test code and steps to reproduce

<!--
Please include code that can be used to test this change and short
description how this example should work.
This snippet should be as minimal as possible and ready to be pasted
into editor (don't exclude exports or remove "not important" parts of
reproduction example)
-->

## Checklist

- [ ] Included code example that can be used to test this change
- [ ] Updated TS types
- [ ] Updated documentation: <!-- For adding new props to native-stack
-->
- [ ]
https://github.com/software-mansion/react-native-screens/blob/main/guides/GUIDE_FOR_LIBRARY_AUTHORS.md
- [ ]
https://github.com/software-mansion/react-native-screens/blob/main/native-stack/README.md
- [ ]
https://github.com/software-mansion/react-native-screens/blob/main/src/types.tsx
- [ ]
https://github.com/software-mansion/react-native-screens/blob/main/src/native-stack/types.tsx
- [ ] Ensured that CI passes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User has minSdkVersion 21 but library was built for 23 [//ReactAndroid/fabricjni]
2 participants