Giter Site home page Giter Site logo

Comments (20)

SudoPlz avatar SudoPlz commented on July 22, 2024 779

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.

from react-native-keychain.

gigeos avatar gigeos commented on July 22, 2024 92

@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
}

from react-native-keychain.

SudoPlz avatar SudoPlz commented on July 22, 2024 12

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.

from react-native-keychain.

Msspl-PrashenjeetRoy avatar Msspl-PrashenjeetRoy commented on July 22, 2024 10

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'
            }
        }
    }
}

from react-native-keychain.

flaviocolonna avatar flaviocolonna commented on July 22, 2024 6

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.

from react-native-keychain.

sirawatGG avatar sirawatGG commented on July 22, 2024 4

@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.

from react-native-keychain.

tomauty avatar tomauty commented on July 22, 2024 2

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

from react-native-keychain.

Baburaomannepalli avatar Baburaomannepalli commented on July 22, 2024 2

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

from react-native-keychain.

gulshanzealous avatar gulshanzealous commented on July 22, 2024

saved the day ! Thanks.

from react-native-keychain.

linrium avatar linrium commented on July 22, 2024

Thank you very much @SudoPlz

from react-native-keychain.

subhajitmondalglb avatar subhajitmondalglb commented on July 22, 2024

@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?

from react-native-keychain.

SudoPlz avatar SudoPlz commented on July 22, 2024

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

from react-native-keychain.

subhajitmondalglb avatar subhajitmondalglb commented on July 22, 2024

@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 ?

from react-native-keychain.

SudoPlz avatar SudoPlz commented on July 22, 2024

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.

from react-native-keychain.

tomauty avatar tomauty commented on July 22, 2024

@SudoPlz you are a godsend

from react-native-keychain.

SudoPlz avatar SudoPlz commented on July 22, 2024

No probs @tomauty I hope that helped :)

from react-native-keychain.

SudoPlz avatar SudoPlz commented on July 22, 2024

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

from react-native-keychain.

sujitpk-perennial avatar sujitpk-perennial commented on July 22, 2024

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

from react-native-keychain.

SudoPlz avatar SudoPlz commented on July 22, 2024

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

from react-native-keychain.

pravinraut809 avatar pravinraut809 commented on July 22, 2024

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

from react-native-keychain.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.