Open hoseineghbal opened 5 years ago
Same issue here
Same issue here.
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"
}
}
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.
@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
@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.
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
@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.
@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") } `
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/'}
}
I am facing the same issue. Can anyone give a solution for this issue? I am stuck in this issue.
@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"
}
}
}
}
}
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'
}
}
}
}
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
@alvarorc thanks your solution works for me.
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!
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'
}
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'.
what is that for ???