Skip to content

Commit d24e733

Browse files
authored
feat: agp 7.3+ fully supported (#980)
1 parent bd72295 commit d24e733

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

android/build.gradle

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,19 @@ repositories {
3030

3131
apply plugin: 'com.android.library'
3232

33+
def supportsNamespace() {
34+
def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
35+
def major = parsed[0].toInteger()
36+
def minor = parsed[1].toInteger()
37+
38+
// Namespace support was added in 7.3.0
39+
if (major == 7 && minor >= 3) {
40+
return true
41+
}
42+
43+
return major >= 8
44+
}
45+
3346
def resolveReactNativeDirectory() {
3447
def reactNativeLocation = safeExtGet("REACT_NATIVE_NODE_MODULES_DIR", null)
3548
if (reactNativeLocation != null) {
@@ -80,9 +93,13 @@ if (isNewArchitectureEnabled()) {
8093
}
8194

8295
android {
83-
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
84-
if (agpVersion.tokenize('.')[0].toInteger() >= 7) {
96+
if (supportsNamespace()) {
8597
namespace "org.wonday.pdf"
98+
sourceSets {
99+
main {
100+
manifest.srcFile "src/main/AndroidManifestNew.xml"
101+
}
102+
}
86103
}
87104
compileSdkVersion safeExtGet('compileSdkVersion', 31)
88105

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
3+
4+
</manifest>

0 commit comments

Comments
 (0)