react-native-tooltips icon indicating copy to clipboard operation
react-native-tooltips copied to clipboard

RN 0.57.4 w/ gradle 4.4 build error

Open badaz opened this issue 7 years ago • 5 comments

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!

badaz avatar Nov 13 '18 19:11 badaz

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

geomih avatar Nov 14 '18 11:11 geomih

Thanks, I'll try that

badaz avatar Nov 14 '18 12:11 badaz

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

Thanks </ Pranav >

prscX avatar Nov 14 '18 14:11 prscX

Done.

geomih avatar Nov 14 '18 20:11 geomih

It works now thanks

badaz avatar Nov 14 '18 21:11 badaz