Skip to content

Commit f8859de

Browse files
committed
fix: incompatibility with AGP 8 & remove jcenter
1 parent 23f2d5e commit f8859de

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

android/build.gradle

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
buildscript {
33
repositories {
44
google()
5-
jcenter()
5+
mavenCentral()
66
}
77

88
dependencies {
@@ -18,12 +18,32 @@ def getExtOrIntegerDefault(name) {
1818
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['RNImageEditor_' + name]).toInteger()
1919
}
2020

21+
def supportsNamespace() {
22+
def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
23+
def major = parsed[0].toInteger()
24+
def minor = parsed[1].toInteger()
25+
26+
// Namespace support was added in 7.3.0
27+
return (major == 7 && minor >= 3) || major >= 8
28+
}
29+
30+
2131
apply plugin: 'com.android.library'
2232

2333
android {
2434
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
2535
buildToolsVersion getExtOrDefault('buildToolsVersion')
2636

37+
if (supportsNamespace()) {
38+
namespace "com.reactnativecommunity.imageeditor"
39+
40+
sourceSets {
41+
main {
42+
manifest.srcFile "src/main/AndroidManifestNew.xml"
43+
}
44+
}
45+
}
46+
2747
defaultConfig {
2848
minSdkVersion getExtOrIntegerDefault('minSdkVersion')
2949
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
</manifest>

0 commit comments

Comments
 (0)