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

RN 0.57.4 w/ gradle 4.4 build error #19

Open
badaz opened this issue Nov 13, 2018 · 5 comments
Open

RN 0.57.4 w/ gradle 4.4 build error #19

badaz opened this issue Nov 13, 2018 · 5 comments
Assignees

Comments

@badaz
Copy link

badaz commented Nov 13, 2018

Hi, first thanks for this module! I'd really love to try it in my project but unfortunately I can't build it after installing / linking / adding the jitpack repo. The error I'm getting is this one :

> Could not resolve all files for configuration ':react-native-tooltips:classpath'.
   > Could not find lint-gradle-api.jar (com.android.tools.lint:lint-gradle-api:26.1.2).
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar

I tried to move the maven { url 'https://jitpack.io' } around in my build.gradle as it can sometimes solve this kind of problem, but it always ends up looking in jcenter... Here is my build.gradle repository config (working prior to installing your package) :

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "27.0.3"
        minSdkVersion = 21
        compileSdkVersion = 27
        targetSdkVersion = 26
        supportLibVersion = "27.1.1"
    }

    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'

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

allprojects {
    repositories {
        google()
        mavenLocal()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        maven {
            // Local Maven repo containing AARs with JSC library built for Android
            url "$rootDir/../node_modules/jsc-android/dist"
        }
    }
}

subprojects {
    project.configurations.all {
        resolutionStrategy.eachDependency { details ->
        if (details.requested.group == 'com.android.support'
                && !details.requested.name.contains('multidex') ) {
                details.useVersion rootProject.ext.supportLibVersion
            }
        }
    }
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion rootProject.ext.compileSdkVersion
                defaultConfig {
                    targetSdkVersion rootProject.ext.targetSdkVersion
                }
            }
        }
    }
}

task wrapper(type: Wrapper) {
    gradleVersion = '4.4'
    distributionUrl = distributionUrl.replace("bin", "all")
}

I also tried removing everything exotic (local maven repos and subprojects section) to check if this was the problem with no luck, still the same error. Since I cannot find any issues referencing this problem I guess it must be quite recent and maybe related to RN 0.57.4? Do you have any info about this?

Thanks again!

@prscX prscX self-assigned this Nov 14, 2018
@geomih
Copy link

geomih commented Nov 14, 2018

I was able to fix this by editing node_modules\react-native-tooltips\android\build.gradle. I added google() and mavenCentral() before jcenter().

@badaz
Copy link
Author

badaz commented Nov 14, 2018

Thanks, I'll try that

@prscX
Copy link
Owner

prscX commented Nov 14, 2018

Thanks @geomih for sharing the solution. Can you please share PR for the same.

Thanks
</ Pranav >

@geomih
Copy link

geomih commented Nov 14, 2018

Done.

@badaz
Copy link
Author

badaz commented Nov 14, 2018

It works now thanks

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

3 participants