File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ import com.android.Version
2+
13def DEFAULT_COMPILE_SDK_VERSION = 30
24def DEFAULT_BUILD_TOOLS_VERSION = ' 30.0.2'
35def DEFAULT_MIN_SDK_VERSION = 16
@@ -30,7 +32,29 @@ if (isNewArchitectureEnabled()) {
3032 apply plugin : ' com.facebook.react'
3133}
3234
35+ // https://github.com/react-native-community/discussions-and-proposals/issues/671
36+ // https://developer.android.com/build/releases/past-releases/agp-8-0-0-release-notes#namespace-dsl
37+ // Namespace is required in module-level when AGP version >=7.3
38+ def supportsNamespace () {
39+ def parsed = Version . ANDROID_GRADLE_PLUGIN_VERSION . tokenize(' .' )
40+ def major = parsed[0 ]. toInteger()
41+ def minor = parsed[1 ]. toInteger()
42+
43+ // Namespace support was added in 7.3.0
44+ return (major == 7 && minor >= 3 ) || major >= 8
45+ }
46+
3347android {
48+ if (supportsNamespace()) {
49+ namespace " com.betomorrow.rnfilelogger"
50+
51+ sourceSets {
52+ main {
53+ manifest. srcFile " src/main/AndroidManifestNew.xml"
54+ }
55+ }
56+ }
57+
3458 compileSdkVersion safeExtGet(' compileSdkVersion' , DEFAULT_COMPILE_SDK_VERSION )
3559 buildToolsVersion safeExtGet(' buildToolsVersion' , DEFAULT_BUILD_TOOLS_VERSION )
3660 defaultConfig {
Original file line number Diff line number Diff line change 1+ <manifest xmlns : android =" http://schemas.android.com/apk/res/android" >
2+
3+ <application >
4+ <provider
5+ android : name =" androidx.core.content.FileProvider"
6+ android : authorities =" ${applicationId}.provider"
7+ android : exported =" false"
8+ android : grantUriPermissions =" true" >
9+ <meta-data
10+ android : name =" android.support.FILE_PROVIDER_PATHS"
11+ android : resource =" @xml/provider_paths" />
12+ </provider >
13+ </application >
14+
15+ </manifest >
You can’t perform that action at this time.
0 commit comments