Skip to content

RN 0.47 seems to be working fine with gradle 4.0 and compileSdkVersion / buildToolsVersion 26 #15448

Closed
@pocesar

Description

@pocesar

The build went from 6 minutes (for a 35 file project) down to 24s, on a second wind after the gradle daemon has already started with at least 1500MB memory...

Maybe encourage new projects to use those optimized settings, since I'm also using a lot of third party android Java modules, with no incompatibilities issues.

my build.gradle looks like this:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
ext {
    compileSdkVersion = 26 // Or what version you want (latest is recommended)
    buildToolsVersion = '26.0.1' // same thing
}

subprojects { subproject ->
    afterEvaluate{
        if((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
            android {
                compileSdkVersion rootProject.ext.compileSdkVersion
                buildToolsVersion rootProject.ext.buildToolsVersion
            }
        }
    }
}

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.+'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

gradle-wrapper.properties:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip

in build.gradle inside app folder

android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion
    // ...

also, I was this settings since 0.46, and react-native-git-upgrade without any issues as well

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions