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

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

Open
hoseineghbal opened this issue Dec 8, 2018 · 16 comments · Fixed by ferbass/audio_recorder#1
Open

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

hoseineghbal opened this issue Dec 8, 2018 · 16 comments · Fixed by ferbass/audio_recorder#1

Comments

@hoseineghbal
Copy link

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
Copy link

rickvdl commented Dec 8, 2018

Same issue here

@seankoole
Copy link

Same issue here.

@wwhitakerV
Copy link

wwhitakerV commented Dec 8, 2018

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
Copy link

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
Copy link

@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
Copy link

fossage commented Dec 8, 2018

@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
Copy link

fanr870606 commented Dec 8, 2018

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
Copy link

@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
Copy link
Author

@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
Copy link

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
Copy link

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

@alvarorc
Copy link

@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
Copy link

krupalagravat commented Dec 11, 2018

}

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
Copy link

}

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
Copy link

@alvarorc thanks your solution works for me.

@n1ru4l
Copy link
Contributor

n1ru4l commented Dec 12, 2018

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet