Skip to content

Commit 9c40440

Browse files
committed
fix: use AndroidManifest.xml for older RN versions
The React Native CLI relies on the filename `AndroidManifest.xml` to be able parse the package name. But we were using `AndroidManifestLegacy.xml` instead which broke the lib for older RN versions (AGP 7). This change makes it so that we use `AndroidManifest.xml` for older RN versions and `AndroidManifestNew.xml` for newer RN versions. Fixes #429
1 parent 44df3f9 commit 9c40440

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

packages/create-react-native-library/templates/native-common/android/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ def supportsNamespace() {
8080
android {
8181
if (supportsNamespace()) {
8282
namespace "com.<%- project.package -%>"
83-
} else {
83+
8484
sourceSets {
8585
main {
86-
manifest.srcFile "src/main/AndroidManifestDeprecated.xml"
86+
manifest.srcFile "src/main/AndroidManifestNew.xml"
8787
}
8888
}
8989
}
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.<%- project.package -%>">
23
</manifest>
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.<%- project.package -%>">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
32
</manifest>

0 commit comments

Comments
 (0)