* Error running Gradle:
ProcessException: Process "C:\Users\chhor\Documents\flutterApps\helloplant\android\gradlew.bat" exited abnormally:
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 resolve com.android.tools.build:gradle:3.2.1.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:3.2.1.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
> Connect to 192.168.0.2:80 [/192.168.0.2] failed: Connection timed out: connect
> Could not resolve com.android.tools.build:gradle:3.2.1.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
> Connect to 192.168.0.2:80 [/192.168.0.2] failed: Connection timed out: connect
> Could not resolve com.android.tools.build:gradle:3.2.1.
> Could not get resource 'https://maven.google.com/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
> Could not GET 'https://maven.google.com/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
> Connect to 192.168.0.2:80 [/192.168.0.2] failed: Connection timed out: connect
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full
insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 4s
Command: C:\Users\chhor\Documents\flutterApps\helloplant\android\gradlew.bat app:properties
Please review your Gradle project setup in the android/ folder.
To solve this problem, add
maven {
url 'https://dl.google.com/dl/android/maven2'
}
in the top of:
jcenter()
and it will give that :
buildscript {
repositories {
google()
maven {
url 'https://dl.google.com/dl/android/maven2'
}
jcenter()
}
Related
Could not find guice-4.2.1-no_aop.jar on a newly initialized quarkus project, not sure why we see this error. Source code is available here - https://pastebin.com/9qaTfb7D
./gradlew build
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'foo-receiver'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not find guice-4.2.1-no_aop.jar (com.google.inject:guice:4.2.1).
Searched in the following locations:
file:/Users/user/.m2/repository/com/google/inject/guice/4.2.1/guice-4.2.1-no_aop.jar
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
I just ran into this and was able to get past that error by modifying the generated settings.gradle file. I moved mavelLocal() to the end of the list of repositories for pluginManagement.
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
mavenLocal()
}
plugins {
id "${quarkusPluginId}" version "${quarkusPluginVersion}"
}
}
In my particular use case, I'm trying to create a subproject in a multi-project Gradle build. Not sure if that's related to this or not.
How to declare 4.1.0-RC1 release of spring-data-elasticsearch
https://github.com/spring-projects/spring-data-elasticsearch/releases
I used the following repositories, but it doesn't seem to work
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-elasticsearch', version: '4.1.0-RC1'
maven { url "http://repo.spring.io/libs-release" }
maven { url "http://repo.spring.io/libs-milestone" }
maven { url "http://repo.spring.io/libs-snapshot" }
* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not resolve org.springframework.boot:spring-boot-starter-data-elasticsearch:4.1.0-RC1.
Required by:
project :
> Could not resolve org.springframework.boot:spring-boot-starter-data-elasticsearch:4.1.0-RC1.
> Could not get resource 'http://repo.spring.io/libs-release/org/springframework/boot/spring-boot-starter-data-elasticsearch/4.1.0-RC1/spring-boot-starter-data-elasticsearch-4.1.0-RC1.pom'.
> Could not GET 'http://repo.spring.io/libs-release/org/springframework/boot/spring-boot-starter-data-elasticsearch/4.1.0-RC1/spring-boot-starter-data-elasticsearch-4.1.0-RC1.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.springframework.boot:spring-boot-starter-data-elasticsearch:4.1.0-RC1.
> Could not get resource 'http://repo.spring.io/libs-milestone/org/springframework/boot/spring-boot-starter-data-elasticsearch/4.1.0-RC1/spring-boot-starter-data-elasticsearch-4.1.0-RC1.pom'.
> Could not GET 'http://repo.spring.io/libs-milestone/org/springframework/boot/spring-boot-starter-data-elasticsearch/4.1.0-RC1/spring-boot-starter-data-elasticsearch-4.1.0-RC1.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.springframework.boot:spring-boot-starter-data-elasticsearch:4.1.0-RC1.
> Could not get resource 'http://repo.spring.io/libs-snapshot/org/springframework/boot/spring-boot-starter-data-elasticsearch/4.1.0-RC1/spring-boot-starter-data-elasticsearch-4.1.0-RC1.pom'.
> Could not GET 'http://repo.spring.io/libs-snapshot/org/springframework/boot/spring-boot-starter-data-elasticsearch/4.1.0-RC1/spring-boot-starter-data-elasticsearch-4.1.0-RC1.pom'. Received status code 403 from server: Forbidden
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
You need to pull in Spring Data Elasticsearch in version 4.1.0-RC1, not the boot starter:
implementation group: 'org.springframework.data', name: 'spring-data-elasticsearch', version: '4.1.0-RC1'
It might be that you have to pull in a RC version of Spring Data Commons as well:
implementation group: 'org.springframework.data', name: 'spring-data-commons', version: '2.4.0-RC1'
Provision worked fine with WildFly: 16.0.x - 17.0.1.
Upgraded provision.gradle to upgrade to use wildFly 18.0.1.
plugins {
id "org.wildfly.build.provision" version '0.0.11'
}
repositories {
mavenLocal()
mavenCentral()
maven {
name 'jboss-nexus'
url "http://repository.jboss.org/nexus/content/groups/public/"
}
}
provision {
// Optional destination directory:
destinationDir = file("wildfly-as/18.0.1.Final")
configuration = file('wildfly-server-provisioning.xml')
// Define variables which need replacing in the provisioning configuration!
variables['wildfly.version'] = '18.0.1.Final'
variables['hibernate-orm.version'] = '5.3.7.Final'
variables['hibernate-search.version'] = '5.11.0.Final'
variables['hibernate-ogm.version'] = '5.4.1.Final'
}
Causes in:
MacBook-Pro:GoStopHandle NOTiFY$ gradle provision -b provision.gradle
Configure project :
Task :provision FAILED Error fetching WildFly component 'org.picketlink:picketlink-api:::2.5.5.SP12-redhat-00006' from
configured repositories; check your repository configurations to
prevent this problem. Attempting to resolve this by enabling
additional repositories automatically! Adding: [mavenLocal(),
mavenCentral() and
http://repository.jboss.org/nexus/content/groups/public/]
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':provision'.
Could not resolve all dependencies for configuration ':detachedConfiguration67'.
Could not find org.picketlink:picketlink-api:2.5.5.SP12-redhat-00006.
Required by:
project :
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it
incompatible with Gradle 7.0. Use '--warning-mode all' to show the
individual deprecation warnings. See
https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 2s 1 actionable task: 1 executed
Any suggestions?
Deleted SDK 14 and 'export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-13.0.2.jdk/Contents/Home/'.
You need to add http://maven.repository.redhat.com/ga/ as repository.
I am trying to building an android-app with Cordova (PhoneGap) but during building I got an exception:
BUILD FAILED in 11s
cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all files for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:3.0.1.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:3.0.1.
> Could not get resource 'https://maven.google.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom'.
> Could not HEAD 'https://maven.google.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom'.
> maven.google.com
> Could not resolve com.android.tools.build:gradle:3.0.1.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom'.
> Could not HEAD 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom'.
> jcenter.bintray.com
* 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
gradle-file
buildscript {
repositories {
maven {
url "https://maven.google.com"
}
jcenter()
google()
}
dependencies {
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
allprojects {
repositories {
maven {
url "https://maven.google.com"
}
jcenter()
}
//This replaces project.properties w.r.t. build settings
project.ext {
defaultBuildToolsVersion="27.0.1" //String
defaultMinSdkVersion=19 //Integer - Minimum requirement is Android 4.4
defaultTargetSdkVersion=27 //Integer - We ALWAYS target the latest by default
defaultCompileSdkVersion=27 //Integer - We ALWAYS compile with the latest by default
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
What causes this exception and how do I fix it? It seems like Cordova is looking for an older version of gradle - could I change it somwhere?
Try creating a new project and see if you get the same error.
If that also fails, try updating your cordova version.
npm update -g cordova
I have been trying to maintain a build server for my team (Android development) with the following setup:
Windows Server 2008
Jenkins
Gradle plugin for Jenkins
Due to forces out of my control, the server has to be offline. It connects to an offline git repo to fetch our source code. We can get temporary internet access if needed to install updates, but otherwise the machine is offline.
However, it has been working fine for a long time (over a year). The pattern we have been using is that if we change dependencies (such as the SDK, or libraries from jcenter such as 'org.greenrobot:greendao:2.2.1') then we get temporary internet access so Gradle will download the dependencies, and then for future offline builds it uses the cache.
Recently we added a new dependency ('com.commonsware.cwac:merge:1.1.+'), which is not in jcenter, but a maven repo at https://s3.amazonaws.com/repo.commonsware.com.
There seems to be an issue with or config, or with Jenkins that prevents the new repo from being cached.
Here is the relevant snip from our root build.gradle:
buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://s3.amazonaws.com/repo.commonsware.com"
}
}
}
Here is a snip from our app build.gradle:
dependencies {
compile 'com.android.support:multidex:1.0.1'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'org.greenrobot:greendao:2.2.1'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.google.android.gms:play-services-location:9.0.0'
compile 'com.commonsware.cwac:merge:1.1.+'
}
When building on Jenkins, if there is internet access the build goes fine.
However, without internet access, it will fail due to the maven repo:
java.net.ConnectException: Connection refused: connect
File C:\Users\ciandroid\.android\repositories.cfg could not be loaded.
Failed to download any source lists!
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApkCopy'.
> Could not resolve com.commonsware.cwac:merge:1.1.+.
Required by:
My-App:app:unspecified
> Could not resolve com.commonsware.cwac:merge:1.1.+.
> Failed to list versions for com.commonsware.cwac:merge.
> Unable to load Maven meta-data from https://s3.amazonaws.com/repo.commonsware.com/com/commonsware/cwac/merge/maven-metadata.xml.
> Could not GET 'https://s3.amazonaws.com/repo.commonsware.com/com/commonsware/cwac/merge/maven-metadata.xml'.
> Connect to s3.amazonaws.com:443 [s3.amazonaws.com/52.216.0.27] failed: Connection refused: connect
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
How can I configure it to cache this other repo? What am I missing?