Skip to content

Commit 85a34fd

Browse files
authored
Update android.js
Fixed android build failure
1 parent 57cae89 commit 85a34fd

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

templates/android.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
module.exports = platform => [{
22
name: () => `${platform}/build.gradle`,
33
content: ({ packageIdentifier }) => `buildscript {
4+
ext.safeExtGet = {prop, fallback ->
5+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
6+
}
47
repositories {
58
google()
69
jcenter()
@@ -9,21 +12,17 @@ module.exports = platform => [{
912
dependencies {
1013
// Matches the RN Hello World template
1114
// https://github.com/facebook/react-native/blob/1e8f3b11027fe0a7514b4fc97d0798d3c64bc895/local-cli/templates/HelloWorld/android/build.gradle#L8
12-
classpath 'com.android.tools.build:gradle:3.3.2'
15+
classpath("com.android.tools.build:gradle:${safeExtGet('gradlePluginVersion', '3.4.1')}")
1316
}
1417
}
1518
1619
apply plugin: 'com.android.library'
1720
apply plugin: 'maven'
1821
19-
def safeExtGet(prop, fallback) {
20-
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
21-
}
22-
23-
def DEFAULT_COMPILE_SDK_VERSION = 27
24-
def DEFAULT_BUILD_TOOLS_VERSION = "27.0.3"
22+
def DEFAULT_COMPILE_SDK_VERSION = 28
23+
def DEFAULT_BUILD_TOOLS_VERSION = "28.0.3"
2524
def DEFAULT_MIN_SDK_VERSION = 16
26-
def DEFAULT_TARGET_SDK_VERSION = 27
25+
def DEFAULT_TARGET_SDK_VERSION = 28
2726
2827
android {
2928
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)

0 commit comments

Comments
 (0)