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

SDK Build Tools revision (23.0.1) is too low for project :react-native-keychain. #68

Closed
SudoPlz opened this issue May 19, 2017 · 20 comments

Comments

@SudoPlz
Copy link

SudoPlz commented May 19, 2017

Hey there,

that might be a noobish question but I get the following error:

* What went wrong:

    A problem occurred configuring project ':app'.

    > Could not resolve all dependencies for configuration ':app:_debugApk'.

       > A problem occurred configuring project ':react-native-keychain'.

          > The SDK Build Tools revision (23.0.1) is too low for project ':react-native-keychain'. Minimum required is 25.0.0

app/build.gradle

android {
compileSdkVersion 25
    buildToolsVersion "25.0.0"
    defaultConfig {
        applicationId 'com.blablaapp.app.android'
        minSdkVersion 16
        targetSdkVersion 22
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
        renderscriptTargetApi 20
        renderscriptSupportModeEnabled true
    }
...


dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')
        compile 'com.android.support:appcompat-v7:25.0.0'
        compile 'com.facebook.react:react-native:+'
        // From node_modules
        compile project(':react-native-background-timer')
        compile project(':react-native-i18n')
        compile project(':react-native-keychain')
        compile project(':react-native-navigation')
        compile project(':react-native-vector-icons')
        compile project(':react-native-orientation')
        compile project(':react-native-linear-gradient')
        compile project(':bugsnag-react-native')
        compile project(':react-native-blur')
        compile project(':react-native-picker')
        compile project(':react-native-svg')
        compile project(':react-native-wheel-picker')
        compile project(':react-native-code-push')
        compile project(':instabug-reactnative')
        compile project(':react-native-maps')
        compile project(':react-native-firebase')
    }

Any ideas what might have went wrong?

Thank you!

@SudoPlz SudoPlz closed this as completed May 19, 2017
@SudoPlz SudoPlz reopened this May 29, 2017
@gigeos
Copy link

gigeos commented May 30, 2017

@SudoPlz Check your android/build.gradle I moved files from a project to an older and I haved to downgrade my build gradle version from 2.3.2 to 2.2.3

dependencies {
    // classpath 'com.android.tools.build:gradle:2.3.2' //before
    classpath 'com.android.tools.build:gradle:2.2.3' //to solve problem
}

@SudoPlz
Copy link
Author

SudoPlz commented May 30, 2017

Ok I found a solution to this.

For people facing the same problem in the future, here's what I did:

I added the following to my root build gradle android/build.gradle
(Not the android/app/build.gradle)

subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion 25
                buildToolsVersion '25.0.0'
            }
        }
    }
}

That forces all the submodules to use the specified compileSdkVersion and buildToolsVersion.
Problem gone now.

@gulshanzealous
Copy link

saved the day ! Thanks.

@linrium
Copy link

linrium commented Jul 11, 2017

Thank you very much @SudoPlz

@subhajitmondalglb
Copy link

@SudoPlz after I have added the lines to force the submodules to use the specified compileSdkVersion , the build problem is gone. But the application is showing message "unfortunately app has stopped". how would I solve it, has anyone faced this issue?

@SudoPlz
Copy link
Author

SudoPlz commented Jul 18, 2017

Hmm, no, I didn't have any problems.
It could be that one of your modules requires an sdk version higher than 25.

@subhajitmondalglb
Copy link

@SudoPlz thanks for your quick reply.
Here are my dependencies:
"dependencies": {
"react": "16.0.0-alpha.12",
"react-native": "0.45.1",
"react-native-blur": "^3.1.2",
"react-native-google-places": "^2.1.0",
"react-native-keyboard-aware-scroll-view": "^0.2.9",
"react-native-vector-icons": "^4.2.0",
"react-navigation": "^1.0.0-beta.11"
},

So what can i do to ?

@SudoPlz
Copy link
Author

SudoPlz commented Jul 18, 2017

Well I'd check each of those projects dependencies to see the minimum sdk they support.

i.e react-native-blur requires version 16 or higher so that's not the problem.

Just a suggestion.

@tomauty
Copy link

tomauty commented Jul 28, 2017

@SudoPlz you are a godsend

@SudoPlz
Copy link
Author

SudoPlz commented Jul 28, 2017

No probs @tomauty I hope that helped :)

@tomauty
Copy link

tomauty commented Jul 28, 2017

We've been clicking "Update build tools and rebuild" for like 15 libs on android studio for months now...haha. So, yes.

@Msspl-PrashenjeetRoy
Copy link

Will the future code look like this? The file path is android/build.gradle

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

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

subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion 25
                buildToolsVersion '25.0.0'
            }
        }
    }
}

@flaviocolonna
Copy link

If you have Android Studio, just import your project into the IDE, and then a warning about this error will be showed. Just click on the link "Update SDK". And it is solved without forcing any library to use a downgraded version of the SDK.

@SudoPlz
Copy link
Author

SudoPlz commented Oct 9, 2017

@flaviocolonna That works if you're building locally, but not if your build is on a CI.

@sujitpk-perennial
Copy link

@SudoPlz Simply Awesome. You are a life saver for all

@SudoPlz
Copy link
Author

SudoPlz commented Nov 24, 2017

No problem man, I'm glad this works for you.

@sirawatGG
Copy link

sirawatGG commented Dec 22, 2017

@SudoPlz Thank you for sharing this solution for us
but I have a question if you don't mind. by following your solution, all packages which use compileSdkVersion lower than 25 will be forced to use 25. What if some packages are not compatible with the newer version? For instance, Facebook-login. Thank you.

@SudoPlz
Copy link
Author

SudoPlz commented Dec 22, 2017

That's a good question @gungungun93.
The solution above is not ideal, but works.
Everyone should take a look at the libraries they're using, and find the lowest common denominator version to use for all projects.

It would be cool if someone wrote a script that checks the module name with a simple if clause, and allows people to manually define the version of each and every dependency individually.

I might do that myself, but I have zero time at the moment.

@pravinraut809
Copy link

after i upgrade version to 25.0.2 , DEX error is coming ,

@Baburaomannepalli
Copy link

Ok I found a solution to this.

For so many peoples facing the same problem in the future, here's what I did:

I added the following to my root build gradle android/build.gradle
(Not the android/app/build.gradle)

subprojects {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 25 0r 26
buildToolsVersion '25.0.0'
}
}
}
}

its working good

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests