Skip to content

Instantly share code, notes, and snippets.

@tlvenn
Forked from AndrewJack/build.gradle
Created March 24, 2017 01:17
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tlvenn/2c8922ec379b48ff421ed0acd6dc824f to your computer and use it in GitHub Desktop.
Save tlvenn/2c8922ec379b48ff421ed0acd6dc824f to your computer and use it in GitHub Desktop.
React Native Android Library SDK Versions
subprojects {
ext {
compileSdk = 25
buildTools = "25.0.1"
minSdk = 19
targetSdk = 25
}
afterEvaluate { project ->
if (!project.name.equalsIgnoreCase("app")
&& project.hasProperty("android")) {
android {
compileSdkVersion compileSdk
buildToolsVersion buildTools
defaultConfig {
minSdkVersion minSdk
targetSdkVersion targetSdk
}
}
}
}
}
@sesam
Copy link

sesam commented Jun 22, 2018

If you're using gradle 3.1.0 which might be needed to work around some other bugs, then update compileSdk to 27 and possibly also increase targetSdk

I added the code block from that gist at the end of android/build.gradle so the topmost or "root" build.gradle for the android version of the app.

This worked in my case:

    compileSdk = 27
    buildTools = "27.0.3"
    minSdk = 16
    targetSdk = 26

I had a dependency set for sdk 16, so had to set minSdk to 16 to avoid one warning about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment