Skip to content

RN-0.73 change Android configs for RN 0.73 compatibility#54

Merged
EmilianoSanchez merged 3 commits into
splitio:developmentfrom
FelipeSSantos1:RN-0.73
Aug 29, 2023
Merged

RN-0.73 change Android configs for RN 0.73 compatibility#54
EmilianoSanchez merged 3 commits into
splitio:developmentfrom
FelipeSSantos1:RN-0.73

Conversation

@FelipeSSantos1

Copy link
Copy Markdown
Contributor

React Native SDK

What did you accomplish?

React Native 0.73 will depend on Android Gradle Plugin (AGP) 8.x. This will require all the libraries to specify a namespace in their build.gradle file.

Details
I'd like to share some of the upcoming changes that will happen in 0.73, which is still a bit far, but we'd rather start earlier rather than later.

React Native 0.73 will depend on Android Gradle Plugin (AGP) 8.x, which brings a lot of improvements for Android apps but also a series of notable changes.

Most importantly:

App/Library Developers will now have to install and use Java 17
Library Developers will have to specify a namespace in their build.gradle file.
Specifically, the last change is a breaking change and will make libraries that are not specifying a namespace incompatible with React Native 0.73 (your project won't build).

Support for namespace was added in AGP 7.3.x, which ships with React Native 0.71. Libraries that published a new version with a namespace declared for 0.71 or 0.72 don't need further update. So we invite library authors to do those changes as soon as possible so by the time 0.73 is out, most of the apps are adapted.

What you need to change
Library authors will have to update their android/build.gradle file as follows:

android {
+   namespace = "io.split.rnsplit"
    ...
}

and remove the package definition from their AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-          package="io.split.rnsplit">
+          >
...
</manifest>

Further reading
Official Google documentation on namespaces is here.

How do we test the changes introduced in this PR?

Extra Notes

@FelipeSSantos1
FelipeSSantos1 requested a review from a team as a code owner June 19, 2023 23:23
@FelipeSSantos1

Copy link
Copy Markdown
Contributor Author

to keep the previous compatibility I added back the namespace on AndroidManifest.
react-native-community/discussions-and-proposals#671 (comment)

@sonarqube-pull-requests

Copy link
Copy Markdown

SonarQube Quality Gate

Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@EmilianoSanchez EmilianoSanchez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you @felipemillhouse so much for the contribution, detailed explanation, and references.

We will include your suggestion to ship soon with the next release.

@EmilianoSanchez
EmilianoSanchez merged commit 5950878 into splitio:development Aug 29, 2023
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.

2 participants