1- buildscript {
2- ext. safeExtGet = {prop , fallback ->
3- rootProject. ext. has(prop) ? rootProject. ext. get(prop) : fallback
4- }
5- repositories {
6- google()
7- mavenCentral()
8- }
9-
10- dependencies {
11- classpath ' com.android.tools.build:gradle:7.0.4'
12- }
1+ ext. safeExtGet = {prop , fallback ->
2+ rootProject. ext. has(prop) ? rootProject. ext. get(prop) : fallback
133}
144
155if (isNewArchitectureEnabled()) {
@@ -26,61 +16,26 @@ android {
2616 versionCode 1
2717 versionName " 1.0"
2818 buildConfigField " boolean" , " IS_NEW_ARCHITECTURE_ENABLED" , isNewArchitectureEnabled(). toString()
29- if (isNewArchitectureEnabled()) {
30- var appProject = rootProject. allprojects. find {it. plugins. hasPlugin(' com.android.application' )}
31- externalNativeBuild {
32- ndkBuild {
33- arguments " APP_PLATFORM=android-21" ,
34- " APP_STL=c++_shared" ,
35- " NDK_TOOLCHAIN_VERSION=clang" ,
36- " GENERATED_SRC_DIR=${ appProject.buildDir} /generated/source" ,
37- " PROJECT_BUILD_DIR=${ appProject.buildDir} " ,
38- " REACT_ANDROID_DIR=${ appProject.rootDir} /../node_modules/react-native/ReactAndroid" ,
39- " REACT_ANDROID_BUILD_DIR=${ appProject.rootDir} /../node_modules/react-native/ReactAndroid/build"
40- cFlags " -Wall" , " -Werror" , " -fexceptions" , " -frtti" , " -DWITH_INSPECTOR=1"
41- cppFlags " -std=c++17"
42- targets " rnaps_modules"
43- }
44- }
45- }
46- }
47- if (isNewArchitectureEnabled()) {
48- externalNativeBuild {
49- ndkBuild {
50- path " src/main/jni/Android.mk"
51- }
52- }
53- }
54- packagingOptions {
55- // For some reason gradle only complains about the duplicated version of libreact_render libraries
56- // while there are more libraries copied in intermediates folder of the lib build directory, we exclude
57- // only the ones that make the build fail (ideally we should only include librnaps_modules but we
58- // are only allowed to specify exclude patterns)
59- exclude " **/libreact_render*.so"
19+
6020 }
21+
6122
6223 buildTypes {
6324 release {
64- minifyEnabled true
65- proguardFile ' proguard-rules.pro'
25+ minifyEnabled false
26+ consumerProguardFiles ' proguard-rules.pro'
6627 }
6728 }
6829}
6930
7031repositories {
71- maven {
72- // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
73- // Matches the RN Hello World template
74- // https://github.com/facebook/react-native/blob/1e8f3b11027fe0a7514b4fc97d0798d3c64bc895/local-cli/templates/HelloWorld/android/build.gradle#L21
75- url " $projectDir /../node_modules/react-native/android"
76- }
7732 mavenCentral()
7833 google()
7934}
8035
8136dependencies {
8237 if (isNewArchitectureEnabled()) {
83- implementation project( " :ReactAndroid " )
38+ implementation( " com.facebook.react:react-android " )
8439 } else {
8540 implementation ' com.facebook.react:react-native:+'
8641 }
0 commit comments