I'm trying to create profile for my andoird application with this command:
./gradlew assemleDebug --dry-run --configure-on-demand --daemon --profile
after run command i get this error:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'CafeAlachiqPro'.
> Could not resolve all files for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:3.0.0-beta2.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-beta2/gradle-3.0.0-beta2.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-beta2/gradle-3.0.0-beta2.jar
Required by:
project :
BUILD FAILED in 7s
I'm using latest version of gradle and i set that on application gradle file as:
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta2'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
}
}
Try to add new Google Maven repository to your build.gradle file:
maven { url 'https://maven.google.com' }
Related
I'm trying to locally build my Android app using cordova. I've downloaded the most recent gradle version but on exporting I get this error:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:6.0.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/6.0.1/gradle-6.0.1.pom
- https://jcenter.bintray.com/com/android/tools/build/gradle/6.0.1/gradle-6.0.1.pom
Required by:
project :
Here is the build.gradle buildscript:
buildscript {
repositories {
mavenCentral()
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:6.0.1'
}
}
allprojects {
repositories {
mavenCentral()
jcenter()
}
}
task wrapper(type: Wrapper) {
gradleVersion = '6.0.1'
}
My gradle-wrapper.properties also states distributionUrl is set to http\://services.gradle.org/distributions/gradle-6.0.1-all.zip
Does anybody know what I'm doing wrong?
Don't confuse gradle with the Android gradle pluing.
The pluing 'com.android.tools.build:gradle:6.0.1' doesn't exist.
The latest stable version of the plugin is: com.android.tools.build:gradle:3.5.2.
After installing nativescript-plugin-firebase I can't build my app anynore with tns build android.
I get this error:
nativescript-plugin-firebase: running release build or change in environment detected, forcing prepare!
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'nativescript_plugin_firebase'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:3.4.2.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.4.2/gradle-3.4.2.pom
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.4.2/gradle-3.4.2.jar
- https://jcenter.bintray.com/com/android/tools/build/gradle/3.4.2/gradle-3.4.2.pom
- https://jcenter.bintray.com/com/android/tools/build/gradle/3.4.2/gradle-3.4.2.jar
Required by:
project :
Here is my platforms/android/build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Here is platforms/android/app/build.gradle:
Here is platforms/tempPlugin/nativescript_plugin_firebase/build.gradle
You probably have another plugin depending on Google Play Services
(Google Maps, perhaps). We need to pin to a specific play services
version to play nice with others, so open
app/App_Resources/Android/app.gradle and add:
Example
android {
project.ext {
googlePlayServicesVersion = "15.0.0" //"16.0.+
}
configurations.all {
resolutionStrategy.force "com.google.android.gms:play-services-auth:$project.googlePlayServicesVersion"
}
}
If same issue coming then use
classpath 'com.android.tools.build:gradle:3.4.1'
FYI Read Android plugin for Gradle HTTP proxy settings
defaultConfig {
...
systemProp.http.proxyHost=proxy.company.com
systemProp.http.proxyPort=443
systemProp.http.proxyUser=userid
systemProp.http.proxyPassword=password
systemProp.http.auth.ntlm.domain=domain
}
After update that SDK on my Jenkin server. I am getting below console error.
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'BuildDevelop'.
Could not resolve all files for configuration ':classpath'.
Could not resolve io.fabric.tools:gradle:1.+.
Required by:
project :
Could not resolve io.fabric.tools:gradle:1.+.
Failed to list versions for io.fabric.tools:gradle.
Could not list versions using M2 pattern 'https://jcenter.bintray.com/[organisation]/[module]/[revision]/[artifact]-revision.[ext]'.
Could not get resource 'https://jcenter.bintray.com/io/fabric/tools/gradle/'.
Could not GET 'https://jcenter.bintray.com/io/fabric/tools/gradle/'.
Read timed out
Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Problem is because bintray is down: http://status.bintray.com
Try this: https://stackoverflow.com/a/49510333/1607169
It's not so good idea, but you can revert com.android.tools.build:gradle:3.1.0 to 3.0.1
And
gradle-4.1-all.zip in distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip in gradle-wrapper.properties
Update your Project build gradle file with maven repo and proper jcenter like below and check:
repositories {
google()
jcenter()
jcenter { url "http://jcenter.bintray.com/" }
maven { url 'https://maven.fabric.io/public' }
maven { url "https://maven.google.com" }
maven { url "http://repo1.maven.org/maven2" }
}
I was running into a similar error and upgraded gradle to version 4.4 and that resolved the gradle sync issues.
You can follow this guide to upgrade, or go to File > Project Structure > Project and enter in 4.4 for the Gradle version
My projet gradle files looks like this:
buildscript {
ext.kotlin_version = '1.2.31'
ext.anko_version='0.10.4'
ext.supportLibVersion = '27.0.2'
repositories {
google()
maven { url 'http://repo1.maven.org/maven2' }
maven { url 'https://jitpack.io' }
maven {
url "https://maven.google.com"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.1.1'
}
}
allprojects {
repositories {
google()
maven { url 'http://repo1.maven.org/maven2' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I tried to build an andruid application using latest andruid studio
Seems that gradle is blocked due to lack of jcenter certificate in local machine certstore. My colleguee succeed to build it on his machine so the problem is in the configuration and not the application code
Configuration : andruid studio 3.0.1, gradle 3.0.0 ?, windows 7
I also tried to workaround ssl handshake by replacing jcenter() in build.gradle with
maven {
url "http://jcenter.bintray.com"
}
but it didn't solve the problem
My build.gradle below:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Gradle console:
Executing tasks: [assemble]
Configuration on demand is an incubating feature.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'PDA'.
> Could not resolve all files for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:3.0.0.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:3.0.0.
> Could not get resource 'http://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom'.
> Could not HEAD 'http://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom'.
> Connect to repo.jfrog.org:80 [repo.jfrog.org/52.72.224.151, repo.jfrog.org/34.204.33.255] failed: Connection timed out: connect
The plugin v.3.x.x
classpath 'com.android.tools.build:gradle:3.0.0'
is not in jcenter.
You have to use the google maven repo.
buildscript {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
If you are using Android Studio 3 and gradle v.4.x you can use the google() shortcut
buildscript {
repositories {
...
google()
}
}
Besides as #GabrieleMariotti alreay said, that library will not be found at JCenter, you should not get Connection timed out: connect but a message that the library was not found.
Connection timed out: connect hints, that you cannot access that URL from your machine. My best guess is that you have to use some Proxy to access this URL that properly configured for your colleague, but not for you.
apple#mosesdeMacBook-Pro:~/Desktop/sxtbdemo2$ react-native run-android
Scanning folders for symlinks in /Users/apple/Desktop/sxtbdemo2/node_modules (8ms)
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'sxtbdemo2'.
Could not resolve all files for configuration ':classpath'.
Could not find com.android.tools.build:gradle:3.0.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.jar
Required by:
project :
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Get more help at https://help.gradle.org
BUILD FAILED in 12s
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have set up your Android development environment: https://facebook.github.io/react-native/docs/android-setup.html
It is usually a problem with your repositories in your gradle files.
for me worked to modify the build.gradle like this:
buildscript {
repositories {
mavenLocal()
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
so when you add google() it should work.
buildscript {
repositories {
jcenter()
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
Add google() inside buildscript() and Sync Project.
Reference : https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html#apply_plugin