mirror of
https://github.com/status-im/react-native-camera-roll.git
synced 2026-08-29 04:11:10 +00:00
feat(android): Add support for upcoming React Native 0.73 (#505)
This commit is contained in:
@@ -113,7 +113,31 @@ if (isNewArchitectureEnabled()) {
|
||||
apply plugin: "com.facebook.react"
|
||||
}
|
||||
|
||||
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger()
|
||||
def shouldUseNameSpace = agpVersion >= 7
|
||||
def PACKAGE_PROP = "package=\"com.reactnativecommunity.cameraroll\""
|
||||
def manifestOutFile = file("${projectDir}/src/main/AndroidManifest.xml")
|
||||
def manifestContent = manifestOutFile.getText()
|
||||
if(shouldUseNameSpace){
|
||||
manifestContent = manifestContent.replaceAll(
|
||||
PACKAGE_PROP,
|
||||
''
|
||||
)
|
||||
} else {
|
||||
if(!manifestContent.contains("$PACKAGE_PROP")){
|
||||
manifestContent = manifestContent.replace(
|
||||
'<manifest',
|
||||
"<manifest $PACKAGE_PROP "
|
||||
)
|
||||
}
|
||||
}
|
||||
manifestContent.replaceAll(" ", " ")
|
||||
manifestOutFile.write(manifestContent)
|
||||
|
||||
android {
|
||||
if(shouldUseNameSpace){
|
||||
namespace = "com.reactnativecommunity.webview"
|
||||
}
|
||||
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
|
||||
|
||||
// Used to override the NDK path/version on internal CI or by allowing
|
||||
|
||||
Reference in New Issue
Block a user