From 30348f789946dc99f5ccd02c85c8decbdb9ac29b Mon Sep 17 00:00:00 2001 From: Dulmandakh Date: Sat, 27 Apr 2019 09:39:35 -0700 Subject: [PATCH] bump android gradle plugin to 3.4.0 (#24463) Summary: This PR bumps Android Gradle Plugin to 3.4.0, which enables R8 shrinker by default and improves build performance significantly. Disabled R8 for ReactAndroid because it'll strip out AndroidX and other libraries bundled in ReactAndroid. [Android] [Changed] - bump Android Gradle plugin to 3.4.0 Pull Request resolved: https://github.com/facebook/react-native/pull/24463 Differential Revision: D15107117 Pulled By: hramos fbshipit-source-id: 35a03dc9955e889c9399faeaf9a862e0fc044fc4 --- ReactAndroid/gradle.properties | 1 + build.gradle | 2 +- react.gradle | 5 +++++ template/android/build.gradle | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ReactAndroid/gradle.properties b/ReactAndroid/gradle.properties index 00b3dcb0d..c35f4245d 100644 --- a/ReactAndroid/gradle.properties +++ b/ReactAndroid/gradle.properties @@ -23,3 +23,4 @@ GLOG_VERSION=0.3.5 android.useAndroidX=true android.enableJetifier=true +android.enableR8=false \ No newline at end of file diff --git a/build.gradle b/build.gradle index 9198857c2..85dec6e68 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ buildscript { jcenter() } dependencies { - classpath("com.android.tools.build:gradle:3.3.2") + classpath("com.android.tools.build:gradle:3.4.0") classpath("de.undercouch:gradle-download-task:3.4.3") // NOTE: Do not place your application dependencies here; they belong diff --git a/react.gradle b/react.gradle index 142a21c8a..11b3465e5 100644 --- a/react.gradle +++ b/react.gradle @@ -148,6 +148,11 @@ afterEvaluate { into ("merged_assets/${variant.name}/merge${targetName}Assets/out") { from(jsBundleDir) } + + // Workaround for Android Gradle Plugin 3.4+ new asset directory + into ("merged_assets/${variant.name}/out") { + from(jsBundleDir) + } } // mergeAssets must run first, as it clears the intermediates directory diff --git a/template/android/build.gradle b/template/android/build.gradle index 6b738db44..99f410470 100644 --- a/template/android/build.gradle +++ b/template/android/build.gradle @@ -13,7 +13,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.2' + classpath("com.android.tools.build:gradle:3.4.0") // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files