Skip to content

Commit 065c5b6

Browse files
dulmandakhfacebook-github-bot
authored andcommittedJun 13, 2018
use android build-tools 26.0.2 and set compileSdk to 26 (#19662)
Summary: Android Target API Level 26 will be required starting from August 2018, it's so soon 😄.Read https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html This PR uses android build tools 26.0.2, support library 26.1.0 (with android lifecycle) and setting compileSdkVersion to 26, but leaving minSdkVersion and targetSdkVersion intact, which will make targeting 26 easy. Circle CI: https://circleci.com/gh/dulmandakh/react-native/209 Everything will build and work just fine. [ANDROID] [ENHANCEMENT] [TOOLS] - Use android build-tools 26.0.2 and set compileSdk to 26, and use support library version 26.1.0. Closes #19662 Differential Revision: D8398855 Pulled By: hramos fbshipit-source-id: a4066eb04cb5f947efe1f3202b638c1092b79aae
1 parent 4f0b9e2 commit 065c5b6

File tree

11 files changed

+119
-27
lines changed

11 files changed

+119
-27
lines changed
 

‎.buckconfig

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11

22
[android]
3-
target = Google Inc.:Google APIs:23
3+
target = android-26
44

55
[download]
66
max_number_of_retries = 3
77

88
[maven_repositories]
99
central = https://repo1.maven.org/maven2
10+
google = https://maven.google.com
1011

1112
[alias]
1213
rntester = //RNTester/android/app:app

‎RNTester/android/app/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ def enableSeparateBuildPerCPUArchitecture = false
8484
def enableProguardInReleaseBuilds = false
8585

8686
android {
87-
compileSdkVersion 23
88-
buildToolsVersion "23.0.1"
87+
compileSdkVersion 26
88+
buildToolsVersion "26.0.2"
8989

9090
defaultConfig {
9191
applicationId "com.facebook.react.uiapp"
@@ -137,7 +137,7 @@ android {
137137

138138
dependencies {
139139
compile fileTree(dir: 'libs', include: ['*.jar'])
140-
compile 'com.android.support:appcompat-v7:23.0.1'
140+
compile 'com.android.support:appcompat-v7:26.1.0'
141141

142142
// Build React Native from source
143143
compile project(':ReactAndroid')

‎ReactAndroid/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ task packageReactNdkLibsForBuck(dependsOn: packageReactNdkLibs, type: Copy) {
245245
}
246246

247247
android {
248-
compileSdkVersion 23
249-
buildToolsVersion "23.0.1"
248+
compileSdkVersion 26
249+
buildToolsVersion "26.0.2"
250250

251251
defaultConfig {
252252
minSdkVersion 16
@@ -295,7 +295,7 @@ android {
295295
dependencies {
296296
compile fileTree(dir: 'src/main/third-party/java/infer-annotations/', include: ['*.jar'])
297297
compile 'javax.inject:javax.inject:1'
298-
compile 'com.android.support:appcompat-v7:23.0.1'
298+
compile 'com.android.support:appcompat-v7:26.1.0'
Has a conversation. Original line has a conversation.
299299
compile 'com.facebook.fbui.textlayoutbuilder:textlayoutbuilder:1.0.0'
300300
compile 'com.facebook.fresco:fresco:1.9.0'
301301
compile 'com.facebook.fresco:imagepipeline-okhttp3:1.9.0'

‎ReactAndroid/libs/BUCK

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ android_prebuilt_aar(
66

77
remote_file(
88
name = "appcompat-binary-aar",
9-
sha1 = "7d659f671541394a8bc2b9f909950aa2a5ec87ff",
10-
url = "mvn:com.android.support:appcompat-v7:aar:23.0.1",
9+
sha1 = "da5771a9ac6e8f3a461360eed3c6f921dc7580fd",
10+
url = "mvn:com.android.support:appcompat-v7:aar:26.1.0",
1111
)
1212

1313
android_prebuilt_aar(

‎ReactAndroid/src/main/third-party/android/support-annotations/BUCK

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ prebuilt_jar(
66

77
remote_file(
88
name = "support-annotations-binary-aar",
9-
sha1 = "1fce89a6428c51467090d7f424e4c9c3dbd55f7e",
10-
url = "mvn:com.android.support:support-annotations:jar:23.0.1",
9+
sha1 = "0814258103cf26a15fcc26ecce35f5b7d24b73f8",
10+
url = "mvn:com.android.support:support-annotations:jar:26.1.0",
1111
)
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,102 @@
1-
android_prebuilt_aar(
1+
android_library(
22
name = "lib-support-v4",
3-
aar = ":lib-support-v4-binary-aar",
3+
exported_deps = [
4+
":lib-support-v4-support-compat",
5+
":lib-support-v4-support-core-utils",
6+
":lib-support-v4-support-core-ui",
7+
":lib-support-v4-support-media-compat",
8+
":lib-support-v4-support-fragment",
9+
":android-lifecycle-runtime",
10+
":android-lifecycle-common.jar",
11+
":android-lifecycle-core.jar"
12+
],
413
visibility = ["PUBLIC"],
514
)
615

16+
prebuilt_jar(
17+
name = "android-lifecycle-common.jar",
18+
binary_jar = ":android-lifecycle-common-jar"
19+
)
20+
21+
prebuilt_jar(
22+
name = "android-lifecycle-core.jar",
23+
binary_jar = ":android-lifecycle-core-jar"
24+
)
25+
26+
android_prebuilt_aar(
27+
name = "android-lifecycle-runtime",
28+
aar = ":android-lifecycle-runtime-aar",
29+
)
30+
31+
android_prebuilt_aar(
32+
name = "lib-support-v4-support-compat",
33+
aar = ":lib-support-v4-support-compat-aar",
34+
)
35+
36+
android_prebuilt_aar(
37+
name = "lib-support-v4-support-core-utils",
38+
aar = ":lib-support-v4-support-core-utils-aar",
39+
)
40+
41+
android_prebuilt_aar(
42+
name = "lib-support-v4-support-core-ui",
43+
aar = ":lib-support-v4-support-core-ui-aar",
44+
)
45+
46+
android_prebuilt_aar(
47+
name = "lib-support-v4-support-media-compat",
48+
aar = ":lib-support-v4-support-media-compat-aar",
49+
)
50+
51+
android_prebuilt_aar(
52+
name = "lib-support-v4-support-fragment",
53+
aar = ":lib-support-v4-support-fragment-aar",
54+
)
55+
56+
remote_file(
57+
name = "android-lifecycle-runtime-aar",
58+
sha1 = "30c60a8a357ee1321ffd0c9f08ef54b24045cd10",
59+
url = "mvn:android.arch.lifecycle:runtime:aar:1.0.0"
60+
)
61+
762
remote_file(
8-
name = "lib-support-v4-binary-aar",
9-
sha1 = "9e8da0e4ecf9f63258c7fbd273889252cba2d0c3",
10-
url = "mvn:com.android.support:support-v4:aar:23.0.1",
63+
name = "android-lifecycle-common-jar",
64+
sha1 = "e414a4cb28434e25c4f6aa71426eb20cf4874ae9",
65+
url = "mvn:android.arch.lifecycle:common:jar:1.0.0"
1166
)
67+
68+
remote_file(
69+
name = "android-lifecycle-core-jar",
70+
sha1 = "a2d487452376193fc8c103dd2b9bd5f2b1b44563",
71+
url = "mvn:android.arch.core:common:jar:1.0.0"
72+
)
73+
74+
remote_file(
75+
name = "lib-support-v4-support-compat-aar",
76+
sha1 = "1e1c8ffc01d277d8f01dfd11d5d2ce3a2af4b98c",
77+
url = "mvn:com.android.support:support-compat:aar:26.1.0",
78+
)
79+
80+
remote_file(
81+
name = "lib-support-v4-support-core-utils-aar",
82+
sha1 = "1bfaae21c4d5c5532c5e732071e9ce234cd58cff",
83+
url = "mvn:com.android.support:support-core-utils:aar:26.1.0",
84+
)
85+
86+
remote_file(
87+
name = "lib-support-v4-support-core-ui-aar",
88+
sha1 = "e306308d54052a1ded7bf9c2f5c2fdf5152a1f22",
89+
url = "mvn:com.android.support:support-core-ui:aar:26.1.0",
90+
)
91+
92+
remote_file(
93+
name = "lib-support-v4-support-media-compat-aar",
94+
sha1 = "09fb587f27cde19aa8f2e50c5c9ee645d9aec44d",
95+
url = "mvn:com.android.support:support-media-compat:aar:26.1.0",
96+
)
97+
98+
remote_file(
99+
name = "lib-support-v4-support-fragment-aar",
100+
sha1 = "ddacf369bb98dd6558606558de8ddcd53895cf91",
101+
url = "mvn:com.android.support:support-fragment:aar:26.1.0",
102+
)

‎ReactAndroid/src/main/third-party/android/support/v7/appcompat-orig/BUCK

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ python_binary(
5656

5757
remote_file(
5858
name = "appcompat-binary-aar",
59-
sha1 = "7d659f671541394a8bc2b9f909950aa2a5ec87ff",
60-
url = "mvn:com.android.support:appcompat-v7:aar:23.0.1",
59+
sha1 = "da5771a9ac6e8f3a461360eed3c6f921dc7580fd",
60+
url = "mvn:com.android.support:appcompat-v7:aar:26.1.0",
6161
)
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dependencies {
22
compile fileTree(dir: "libs", include: ["*.jar"])
3-
compile "com.android.support:appcompat-v7:23.0.1"
4-
compile "com.facebook.react:react-native:0.18.+"
3+
compile "com.android.support:appcompat-v7:26.1.0"
4+
compile "com.facebook.react:react-native:+"
55
}

‎local-cli/link/__fixtures__/android/patchedBuild.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ dependencies {
44
exclude(group: 'org.unwanted', module: 'test10')
55
}
66
compile fileTree(dir: "libs", include: ["*.jar"])
7-
compile "com.android.support:appcompat-v7:23.0.1"
8-
compile "com.facebook.react:react-native:0.18.+"
7+
compile "com.android.support:appcompat-v7:26.1.0"
8+
compile "com.facebook.react:react-native:+"
99
}

‎local-cli/templates/HelloWorld/android/app/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ def enableSeparateBuildPerCPUArchitecture = false
9494
def enableProguardInReleaseBuilds = false
9595

9696
android {
97-
compileSdkVersion 23
98-
buildToolsVersion "23.0.1"
97+
compileSdkVersion 26
98+
buildToolsVersion "26.0.2"
9999

100100
defaultConfig {
101101
applicationId "com.helloworld"
@@ -138,7 +138,7 @@ android {
138138

139139
dependencies {
140140
compile fileTree(dir: "libs", include: ["*.jar"])
141-
compile "com.android.support:appcompat-v7:23.0.1"
141+
compile "com.android.support:appcompat-v7:26.1.0"
142142
compile "com.facebook.react:react-native:+" // From node_modules
143143
}
144144

‎scripts/.tests.env

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
## ANDROID ##
66
# Android SDK Build Tools revision
7-
export ANDROID_SDK_BUILD_TOOLS_REVISION=23.0.1
7+
export ANDROID_SDK_BUILD_TOOLS_REVISION=26.0.2
88
# Android API Level we build with
9-
export ANDROID_SDK_BUILD_API_LEVEL="23"
9+
export ANDROID_SDK_BUILD_API_LEVEL="26"
1010
# Google APIs for Android level
1111
export ANDROID_GOOGLE_API_LEVEL="23"
1212
# Minimum Android API Level we target

3 commit comments

Comments
 (3)

willbattel commented on Jun 13, 2018

@willbattel

Why are you targeting API 26 and not 27? Buildtools 26.X.X is already considered outdated by Gradle Android Plugin 3.X.X. Seems weird to only target the minimum required by Google, as opposed to the recommended version.

noktigula commented on Jun 15, 2018

@noktigula

Is there any planned changes to update minSdk?

dulmandakh commented on Jun 18, 2018

@dulmandakh
ContributorAuthor

You can change it for your project as you wish. For August version or 0.57, we'll update targetSdk to 26, requirement from Play Store.

Please sign in to comment.