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

Build Tools revision (23.0.1) is too low for project #428

Closed
zr0n opened this issue Mar 19, 2017 · 35 comments

Comments

@zr0n
Copy link

commented Mar 19, 2017

When I try tu build my project, I am getting this error
The SDK Build Tools revision (23.0.1) is too low for project 'react-native-vector-icons'. Minimum required is 25.0.0.

And the only way I can build is to set the buildToolsVersion to "25.0.0" inside the build.gradle file

Is there another solution?

@rob-64

This comment has been minimized.

Copy link

commented Mar 22, 2017

@zr0n downgrade some areas your build dependencies, android studio probably asked you to upgrade.

build.gradle:
classpath 'com.android.tools.build:gradle:2.2.3'

app/build.gradle:
buildToolsVersion "23.0.1"

@zr0n

This comment has been minimized.

Copy link
Author

commented Mar 22, 2017

If I downgrade my build dependencies as you said and do not upgrade the react-native-vector-icons dependencies the error persists.

@rob-64

This comment has been minimized.

Copy link

commented Mar 22, 2017

Can you post your app build.gradle

@zr0n

This comment has been minimized.

Copy link
Author

commented Mar 22, 2017

`apply plugin: "com.android.application"

import com.android.build.OutputFile

/**

  • The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
  • and bundleReleaseJsAndAssets).
  • These basically call react-native bundle with the correct arguments during the Android build
  • cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
  • bundle directly from the development server. Below you can see all the possible configurations
  • and their defaults. If you decide to add a configuration block, make sure to add it before the
  • apply from: "../../node_modules/react-native/react.gradle" line.
  • project.ext.react = [
  • // the name of the generated asset file containing your JS bundle
  • bundleAssetName: "index.android.bundle",
  • // the entry file for bundle generation
  • entryFile: "index.android.js",
  • // whether to bundle JS and assets in debug mode
  • bundleInDebug: false,
  • // whether to bundle JS and assets in release mode
  • bundleInRelease: true,
  • // whether to bundle JS and assets in another build variant (if configured).
  • // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
  • // The configuration property can be in the following formats
  • // 'bundleIn${productFlavor}${buildType}'
  • // 'bundleIn${buildType}'
  • // bundleInFreeDebug: true,
  • // bundleInPaidRelease: true,
  • // bundleInBeta: true,
  • // the root of your project, i.e. where "package.json" lives
  • root: "../../",
  • // where to put the JS bundle asset in debug mode
  • jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
  • // where to put the JS bundle asset in release mode
  • jsBundleDirRelease: "$buildDir/intermediates/assets/release",
  • // where to put drawable resources / React Native assets, e.g. the ones you use via
  • // require('./image.png')), in debug mode
  • resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
  • // where to put drawable resources / React Native assets, e.g. the ones you use via
  • // require('./image.png')), in release mode
  • resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
  • // by default the gradle tasks are skipped if none of the JS files or assets change; this means
  • // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
  • // date; if you have any other folders that you want to ignore for performance reasons (gradle
  • // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
  • // for example, you might want to remove it from here.
  • inputExcludes: ["android/", "ios/"],
  • // override which node gets called and with what additional arguments
  • nodeExecutableAndArgs: ["node"]
  • // supply additional arguments to the packager
  • extraPackagerArgs: []
  • ]
    */

apply from: "../../node_modules/react-native/react.gradle"

/**

  • Set this to true to create two separate APKs instead of one:
    • An APK that only works on ARM devices
    • An APK that only works on x86 devices
  • The advantage is the size of the APK is reduced by about 4MB.
  • Upload all the APKs to the Play Store and people will download
  • the correct one based on the CPU architecture of their device.
    */
    def enableSeparateBuildPerCPUArchitecture = false

/**

  • Run Proguard to shrink the Java bytecode in release builds.
    */
    def enableProguardInReleaseBuilds = false

android {
compileSdkVersion 23
buildToolsVersion '23.0.1'

defaultConfig {
    applicationId "com.applivroderecordacoes"
    minSdkVersion 16
    targetSdkVersion 22
    versionCode 1
    versionName "0.1.0"
    ndk {
        abiFilters "armeabi-v7a", "x86"
    }
}
splits {
    abi {
        reset()
        enable enableSeparateBuildPerCPUArchitecture
        universalApk false  // If true, also generate a universal APK
        include "armeabi-v7a", "x86"
    }
}
buildTypes {
    release {
        minifyEnabled enableProguardInReleaseBuilds
        proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
    }
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
    variant.outputs.each { output ->
        // For each separate APK per architecture, set a unique version code as described here:
        // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
        def versionCodes = ["armeabi-v7a":1, "x86":2]
        def abi = output.getFilter(OutputFile.ABI)
        if (abi != null) {  // null for the universal-debug, universal-release variants
            output.versionCodeOverride =
                    versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
        }
    }
}

}

dependencies {
compile project(':react-native-vector-icons')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
`

@rob-64

This comment has been minimized.

Copy link

commented Mar 22, 2017

did you clean and build ?

@aljones15

This comment has been minimized.

Copy link

commented Apr 1, 2017

getting the same error. anyone got a solution for this? I did a grep and all of my sdk versions are 23.0.1

@zr0n

This comment has been minimized.

Copy link
Author

commented Apr 1, 2017

@aljones15 The fix for me was set the buildToolsVersion to "25.0.0" inside this build.gradle file
And update my build-tools to 25.0.0 in Android SDK Manager

@FunProject

This comment has been minimized.

Copy link

commented Apr 3, 2017

I have the same problem.

@aljones15

This comment has been minimized.

Copy link

commented Apr 3, 2017

@zr0n that's interesting. I did it by upgrading react-native to the latest version then doing react-native upgrade and overwriting the templates. that reset me to sdk 23 which worked fine.

@Sunshine168

This comment has been minimized.

Copy link

commented Apr 4, 2017

Hi i have the same problem after i yarn add react-native-elements and having problem so i reinstall all the module .
we can fix this problem in android-studio with sync the gradle
but why min version request 25 ?

@bramvbilsen

This comment has been minimized.

Copy link

commented Apr 4, 2017

Okay so I'm having the same problem atm. It worked perfectly fine with lowers sdks on another pc... Any easy fix for this found yet?

@Lenin7

This comment has been minimized.

Copy link

commented Apr 4, 2017

Any updates? (windows related only)?

@bramvbilsen

This comment has been minimized.

Copy link

commented Apr 4, 2017

This is what I did to "fix" it.
So I did originally install the plugin with npm, but then this bug came along.
So I uninstalled it with npm uninstall and reinstalled it with yarn add. After that I cleaned the gradle and everything worked again for some reason.

@PeterRock

This comment has been minimized.

Copy link

commented Apr 5, 2017

It was caused by node_modules/react-native-vector-icons/android/build.gradle, in the section of buildToolsVersion: 23.0.1.
You can change it into 25.0.0 or Use the lasted Android Studio: when you open you project by it, it will notice you that the build tool is too old, please click the update link, then you've got it.
It's easy to fix this.

@bramvbilsen

This comment has been minimized.

Copy link

commented Apr 5, 2017

@PeterRock that's what I don't get, I didn't do any of that and it just started working again for some reason.

@hanweixing

This comment has been minimized.

Copy link

commented May 5, 2017

I Modify my code like above @zr0n , and it still appear this err. So i try to clen cache, then it works, maybe others can try this.

React Native Clear Cache:

watchman watch-del-all
rm -rf node_modules
npm cache clean
npm install
npm start --reset-cache

@deathemperor

This comment has been minimized.

Copy link

commented Jun 6, 2017

this issue is annoying if you try to fix it by changing https://github.com/oblador/react-native-vector-icons/blob/master/android/build.gradle, whenever I run yarn it will be reverted back to 23.0.1. It needs a better solution.

@rish

This comment has been minimized.

Copy link

commented Jun 8, 2017

This solution seems to work for me:

oblador/react-native-keychain#68 (comment)

@deathemperor

This comment has been minimized.

Copy link

commented Jun 9, 2017

This solution seems to work for me:
oblador/react-native-keychain#68 (comment)

it works! thanks @rish

@HelloEdit

This comment has been minimized.

Copy link

commented Jun 26, 2017

Try to downgrade your gradle version, it could work

@zr0n

This comment has been minimized.

Copy link
Author

commented Jun 27, 2017

I guess the solution below, posted by @rish is the best one.
Thank u all
oblador/react-native-keychain#68 (comment)

@HelloEdit

This comment has been minimized.

Copy link

commented Jun 27, 2017

Sadly, I'm with build tools version 26.0.0 ...

@zr0n

This comment has been minimized.

Copy link
Author

commented Jun 27, 2017

@HelloEdit Check the link, just change text to use with your build tools version

@HelloEdit

This comment has been minimized.

Copy link

commented Jun 27, 2017

Oh I'm sorry, I confused your comment with my other issue about AIDL, I'm confused 😄, my problem is not the same

@sandeeplondhe

This comment has been minimized.

Copy link

commented Jun 28, 2017

It's working fine when I change the Gradle Version from 2.3.3 to 2.2.3.

@HelloEdit

This comment has been minimized.

Copy link

commented Jun 28, 2017

I just change my build tools to version 25.0.1 and my SDK version to 25. Then I upgrade my gradle version and the gradle plugin. And it's work like a charm !

@dkadlecek

This comment has been minimized.

Copy link

commented Jul 18, 2017

Please update the build.gradle file to use the latest SDK & Tools version

@HelloEdit

This comment has been minimized.

Copy link

commented Jul 19, 2017

Hello, everyone
No need to update the build.gradle, just add these lines in YOUR android/build.gradle (cc @dkadlecek)

[...]

subprojects { subproject ->
    afterEvaluate{
        if((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
            android {
                compileSdkVersion 25
                buildToolsVersion "25.0.1"
            }
        }
    }
}

[...]
@oblador

This comment has been minimized.

Copy link
Owner

commented Jul 30, 2017

4.3.0 now uses build tools version 26 if that helps anyone. LMK if I can close this issue.

@oblador oblador closed this Oct 8, 2017
@AmirTahani

This comment has been minimized.

Copy link

commented Jan 17, 2018

you saved my day @HelloEdit

@hanspoo

This comment has been minimized.

Copy link

commented Jun 6, 2018

In my case the project was defined to use build tools 23.0.0 and with this find with sed i upgraded this to 25.0.0:
find . -name build.gradle -exec sed -i s/23.0.1/25.0.1/ "{}" ;

@hungdev

This comment has been minimized.

Copy link

commented Jul 15, 2018

go to node_modules/library name/android/build.gradle
edit

    compileSdkVersion 23
    buildToolsVersion "23.0.1"

To

    compileSdkVersion 26
    buildToolsVersion "26.0.1"

run again.

@alisput

This comment has been minimized.

Copy link

commented Jul 30, 2018

You should open the your project with Android Studio. It shows the error. And you can change 23.0.0 to 25.0.0 or up. Rebuild it. After that close Android Studio and run react-native run-android. That is it.

@bugracelenk

This comment has been minimized.

Copy link

commented Aug 17, 2018

Hello,
For my case i was getting error with "react-native-youtube" module.
So i opened my project with android studio and then clicked on the left side "Gradle Scripts"
and i found the module that causes me problem.
Than i opened build.gradle (Module: react-native-youtube)

After this i just changed

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"

defaultConfig {
    minSdkVersion 16
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
}
lintOptions {
    abortOnError false
}

}

this to

android {
compileSdkVersion 27
buildToolsVersion "27.0.3"

defaultConfig {
    minSdkVersion 16
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
}
lintOptions {
    abortOnError false
}

}

And that was working like charm ^^

As i said earlier for my case that was react-native youtube module just do it for your module and it will help. ^^

@lucasriondel

This comment has been minimized.

Copy link

commented Aug 28, 2018

To anyone coming from google using the latest React Native version, this did the job for me (add to your android/build.gradle) :

subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion 27
                buildToolsVersion "27.0.2"
            }
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.