Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update all the android related projects to target API level 27 #17741

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions RNTester/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ def enableSeparateBuildPerCPUArchitecture = false
def enableProguardInReleaseBuilds = false

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
compileSdkVersion 27
buildToolsVersion "27.0.2"

defaultConfig {
applicationId "com.facebook.react.uiapp"
minSdkVersion 16
targetSdkVersion 23
targetSdkVersion 27
versionCode 1
versionName "1.0"
ndk {
Expand Down
2 changes: 1 addition & 1 deletion RNTester/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="23" />
Copy link
Contributor

@gengjiawen gengjiawen May 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, delete those, they are not needed anyone with version code and name.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah to quote the error message I'm getting in Android Studio 3.2 canary 14

The minSdk version should not be declared in the android manifest file. You can move the version from the manifest to the defaultConfig in the build.gradle file.

Copy link
Contributor Author

@SandroMachado SandroMachado May 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that it is required by buck.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks Android projects with RN components (it actually doesn't let me successfully run a debug build without that removed). Is it possible to have buck adjusted? Can it not read it from the gradle file instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately I am not familiarised with buck. I will try to investigate.

android:targetSdkVersion="27" />

<!--
android:icon is used to display launcher icon on mobile devices.
Expand Down
6 changes: 3 additions & 3 deletions ReactAndroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,12 @@ task packageReactNdkLibsForBuck(dependsOn: packageReactNdkLibs, type: Copy) {
}

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
compileSdkVersion 27
buildToolsVersion "27.0.2"

defaultConfig {
minSdkVersion 16
targetSdkVersion 22
targetSdkVersion 27
versionCode 1
versionName "1.0"

Expand Down
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.android.tools.build:gradle:2.3.3'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why this can't be bumped to higher versions like 3.0.0? As per its release notes, 3.0.0 offers better compilations speeds and requires Build Tools 26.0.2 or higher.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, shouldn't the gradle-wrapper.properties distributionUrl be bumped?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumping to the 3.0.0 is out of the scope for this PR. IMO, should be done in another PR.

classpath 'de.undercouch:gradle-download-task:3.1.2'

// NOTE: Do not place your application dependencies here; they belong
Expand All @@ -18,6 +18,7 @@ allprojects {
repositories {
jcenter()
mavenLocal()
google()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think gradle 2.14.1 has google.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be upgrading to gradle 3.x soon anyway - #17747

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer gradle 4.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gradle 4 would be the ideal solution but an upgrade to 3 is a start


def androidSdk = System.getenv("ANDROID_SDK")
maven {
Expand Down
6 changes: 3 additions & 3 deletions local-cli/templates/HelloWorld/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ def enableSeparateBuildPerCPUArchitecture = false
def enableProguardInReleaseBuilds = false

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
compileSdkVersion 27
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hramos 26 or 27, I think we best stay to one version

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible, try and stick to the highest one. Has to be at least 26 to fix this issue.

buildToolsVersion "27.0.2"

defaultConfig {
applicationId "com.helloworld"
minSdkVersion 16
targetSdkVersion 22
targetSdkVersion 27
versionCode 1
versionName "1.0"
ndk {
Expand Down
2 changes: 2 additions & 0 deletions local-cli/templates/HelloWorld/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ allprojects {
repositories {
mavenLocal()
jcenter()
google()

maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
Expand Down