Skip to content

Commit 7399492

Browse files
authored
feat(all): add namespace when ANDROID_GRADLE_PLUGIN_VERSION >=7
1 parent 8c21be8 commit 7399492

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

android/build.gradle

+5-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ def getExtOrIntegerDefault(name) {
3636

3737
android {
3838
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
39-
namespace = "com.reactnativepagerview"
39+
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
40+
if (agpVersion.tokenize('.')[0].toInteger() >= 7) {
41+
namespace = "com.reactnativepagerview"
42+
}
43+
4044
defaultConfig {
4145
minSdkVersion getExtOrIntegerDefault('minSdkVersion')
4246
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')

android/src/main/AndroidManifest.xml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
22
package="com.reactnativepagerview">
3+
34
</manifest>

0 commit comments

Comments
 (0)