DylanVann / react-native-fast-image

🚩 FastImage, performant React Native image component.
MIT License
8.17k stars 1.5k forks source link

Could not find com.android.tools:common:25.3.3. #366

Open hoseineghbal opened 5 years ago

hoseineghbal commented 5 years ago

i can not build my android project on mac with this build.gradle : `// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript { ext { buildToolsVersion = "27.0.3" minSdkVersion = 16 compileSdkVersion = 27 targetSdkVersion = 26 supportLibVersion = "27.1.1" } repositories { jcenter() 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 { mavenLocal() jcenter() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url "$rootDir/../node_modules/react-native/android" } google() } }

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

this error happend::

`A problem occurred configuring project ':react-native-fast-image'.

Could not resolve all artifacts for configuration ':react-native-fast-image:classpath'. Could not find com.android.tools:common:25.3.3. Searched in the following locations: https://jcenter.bintray.com/com/android/tools/common/25.3.3/common-25.3.3.pom https://jcenter.bintray.com/com/android/tools/common/25.3.3/common-25.3.3.jar Required by: project :react-native-fast-image > com.android.tools.build:gradle:2.3.3 > com.android.tools.build:gradle-core:2.3.3 > com.android.tools.build:builder:2.3.3 project :react-native-fast-image > com.android.tools.build:gradle:2.3.3 > com.android.tools.build:gradle-core:2.3.3 > com.android.tools.build:builder:2.3.3 > com.android.tools.build:manifest-merger:25.3.3 project :react-native-fast-image > com.android.tools.build:gradle:2.3.3 > com.android.tools.build:gradle-core:2.3.3 > com.android.tools.build:builder:2.3.3 > com.android.tools.ddms:ddmlib:25.3.3`

what is that for ???

rickvdl commented 5 years ago

Same issue here

seankoole commented 5 years ago

Same issue here.

wwhitakerV commented 5 years ago

Hey guys, this worked for me.... in the react-native-fast-image build.gradle file replace your buildscript dependency version to 2.3.0.

After doing some research the 2.3.3 version is looking for a file that has dissappeared from jcenter -> https://jcenter.bintray.com/com/android/tools/common/ <- head there and you'll see that 25.3.3 is gone. Not sure what's going on here, but my app is running as expected now.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:2.3.0"
    }
}
KalebMatthews commented 5 years ago

If we are using this as an npm package and using a build server like App Center to handle our builds it is impossible to do the fix above except through a complicated script. This has to be resolved by a code change in this package for that situation. Unless someone has a better idea. This is urgent my project as I was trying to push some hot fixes out but now I can not.

wwhitakerV commented 5 years ago

@KalebMatthews I am using npm package as well... try navigating to your node_modules folder and looking through the packages until you see react-native-fast-image. I hope this helps, just see if you can access it

fossage commented 5 years ago

@wwhitakerV , that works fine if you are building locally, however if you are having a CI server running your build, this won't work because it installs the package fresh each time.

fanr870606 commented 5 years ago

In your app build.gradle you can add:

subprojects {project ->
    if (project.name.contains('your module name, E.g. react-native-fast-image')) {
            buildscript {
                repositories {
                maven { url : 'Different repository'  }
            }    
        }
    }
}

You could use something like

maven { url : "https://dl.bintray.com/android/android-tools/" }

I had the same problem, this works for me. I use Bitrise

KalebMatthews commented 5 years ago

@wwhitakerV I use App Center for my build management which grabs your project from GitHub then does its own npm install without any input from you. It is NOT a local build and you would have to write your own pre-build script to do what you are suggesting which would be complicated to say the least.

@fanr870606 I will try that out and see what I can do with it. Thanks. And I was looking at moving to Bitrise as well after all the issues I have run into with App Center. I was gonna talk about it with my team on Monday. Funny you brought that up.

hoseineghbal commented 5 years ago

@fanr870606

thanks a lot it's work perfect and this is my final buid.gradle for other people as a refrence ...

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

buildscript { ext { buildToolsVersion = "27.0.3" minSdkVersion = 16 compileSdkVersion = 27 targetSdkVersion = 26 supportLibVersion = "27.1.1" } repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.2.1'

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

}

allprojects { repositories { google() maven { url "$rootDir/../node_modules/react-native/android" } maven { url "https://maven.google.com" } 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 {project -> if (project.name.contains('react-native-fast-image')) { buildscript { repositories { maven { url = "https://dl.bintray.com/android/android-tools/" } } } } }

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

tomoima525 commented 5 years ago

FYI dl.bintray.com/android/android-tools shouold be https://dl.bintray.com/android/android-tools/ (I guess the link was shortened by github when posted)

repositories {
   maven { url = 'https://dl.bintray.com/android/android-tools/'}
}
MSSPL-PiyaleeMaiti commented 5 years ago

I am facing the same issue. Can anyone give a solution for this issue? I am stuck in this issue.

alvarorc commented 5 years ago

@MSSPL-PiyaleeMaiti suggestion from @fanr870606 works for me... try to use Android Studio to find which module is failed to build... In my case I had to change two modules

subprojects {project ->
    if (project.name.contains('react-native-image-picker')) {
        buildscript {
            repositories {
                maven { url "https://dl.bintray.com/android/android-tools/"  }
            }
        }
    }
    if (project.name.contains('react-native-vector-icons')) {
        buildscript {
            repositories {
                maven { url "https://dl.bintray.com/android/android-tools/"  }
            }
            dependencies {
                classpath "com.android.tools.build:gradle:2.3.0"
            }
        }
    }
}
krupalagravat commented 5 years ago

}

Guys also have to add :
dependencies { classpath 'com.android.tools.build:gradle:2.2.3' }

if (project.name.contains('react-native-fast-image')|| project.name.contains('react-native-svg')) {
        buildscript {
            repositories {
                jcenter()
                google()
                maven { url "https://dl.bintray.com/android/android-tools/" }
            }
            dependencies {
                classpath 'com.android.tools.build:gradle:2.2.3'
            }
        }
    }
ederalexss commented 5 years ago

}

Guys also have to add : dependencies { classpath 'com.android.tools.build:gradle:2.2.3' }

if (project.name.contains('react-native-fast-image')|| project.name.contains('react-native-svg')) {
        buildscript {
            repositories {
                jcenter()
                google()
                maven { url "https://dl.bintray.com/android/android-tools/" }
            }
            dependencies {
                classpath 'com.android.tools.build:gradle:2.2.3'
            }
        }
    }

Could not find gradle.jar (com.android.tools.build:gradle:2.3.3). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/build/gradle/2.3.3/gradle-2.3.3.jar

MSSPL-PiyaleeMaiti commented 5 years ago

@alvarorc thanks your solution works for me.

n1ru4l commented 5 years ago

Maybe off-topic but: @hoseineghbal Did you know you can highlight code? https://help.github.com/articles/creating-and-highlighting-code-blocks/

thx to @fanr870606!