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
Related
I am a Gradle newbie, having used Maven in the past.
I successfully established a Vaadin 22.0.5 project using the Vaadin Latest - Gradle starter project downloaded from Hello World Starters page. The project successfully builds and runs using gretty > apprun in IntelliJ 2021.1 EAP Ultimate edition.
👉 How do I alter the project to use the current beta version of the next version, Vaadin 23.0.0.beta2, as listed on the Vaadin releases page?
First attempt
I changed the gradle.properties file which consists of this single line:
vaadinVersion=22.0.5
… to this:
vaadinVersion=23.0.0.beta2
I clicked the floating windoid, Load Gradle Changes.
I immediately see this error appear in the IDE’s Build pane:
Build file '/Users/my_user/IdeaProjects/GetJava/build.gradle' line: 11
Plugin [id: 'com.vaadin', version: '23.0.0.beta2'] was not found in any of the following sources:
* 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.
Second attempt
After receiving Answer by cfrick, I did the following.
If found this at the top of the build.gradle file:
buildscript {
repositories {
maven { setUrl("https://maven.vaadin.com/vaadin-prereleases") }
maven { url "https://plugins.gradle.org/m2/" }
}
}
So I made no edits there, as seemed to be accomplishing the same thing as the first part of the Answer.
I changed the entirety of the settings.gradle file from this:
pluginManagement {
plugins {
id 'com.vaadin' version "${vaadinVersion}"
}
}
… to this:
pluginManagement {
repositories {
gradlePluginPortal()
maven {
url = "https://maven.vaadin.com/vaadin-prereleases"
}
}
plugins {
id 'com.vaadin' version "${vaadinVersion}"
}
}
I changed the gradle.properties file which consists of this single line:
vaadinVersion=22.0.5
… to this, using beta1 rather than beta2 seen above.
vaadinVersion=23.0.0.beta1
After executing Tasks > build > clean, I get a BUILD SUCCESSFUL message.
But when I execute Gretty > apprun, I get the following error message.
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not find com.vaadin:vaadin-bom:23.0.0.beta1.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/com/vaadin/vaadin-bom/23.0.0.beta1/vaadin-bom-23.0.0.beta1.pom
If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
Required by:
project :
> Could not find com.vaadin:vaadin-core:.
Required by:
project :
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
Pre-release versions are released first in Vaadins own pre-release
repository. You would have to add the repository if you need access to
releases, that have not yet hit the public repos:
In build.gradle expand repositories by:
repositories {
// ...
maven {
url = "https://maven.vaadin.com/vaadin-prereleases"
}
}
In the settings.gradle add a repositories block too:
pluginManagement {
repositories {
gradlePluginPortal()
maven {
url = "https://maven.vaadin.com/vaadin-prereleases"
}
}
plugins {
id 'com.vaadin' version "${vaadinVersion}"
}
}
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.
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.
Upgrading from Gradle 4.0 to 6.1, the com.moowork.glup plugin seems to have vanished. Yet, the https://plugins.gradle.org/plugin/com.moowork.gulp page show that the plugin does exist. The sample code works with the com.moowork.gulp line commented out.
plugins {
id 'java'
id 'maven'
id "com.moowork.gulp" version "1.3.0"
id "nebula.ospackage" version "8.0.3"
}
task testAgain {
println 'Configuration stage'
doLast {
println 'Execution stage'
}
}
Once the offending line is uncommented, the Gradle example fails.
$ ./gradlew -q testAgain
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'example'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not find com.moowork.gradle:gradle-node-plugin:1.3.0.
Searched in the following locations:
- https://plugins.gradle.org/m2/com/moowork/gradle/gradle-node-plugin/1.3.0/gradle-node-plugin-1.3.0.pom
If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
Required by:
project : > com.moowork.gulp:com.moowork.gulp.gradle.plugin:1.3.0
[...]
BUILD FAILED in 1s
What am I missing?
Applications are not running on android but running well on ios, error says that there is a problem in gradle although native android projects run well in android studio, I tried google and other threads on stackoverflow with no luck.**
N.B: the error occurs regardless the project, it always happens even with newly created projects in flutter. Thanks
* Error running Gradle:
ProcessException: Process "/Users/apple/Documents/flutter_work/tqtqt/android/gradlew" exited abnormally:
Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
* What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/4.10.2/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Error: Could not find or load main class org.gradle.launcher.daemon.bootstrap.GradleDaemon
* 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
Command: /Users/apple/Documents/flutter_work/tqtqt/android/gradlew app:properties
Please review your Gradle project setup in the android/ folder.
build.gradle
buildscript {
ext.kotlin_version = '1.2.71'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Try to run flutter clean on project folder and run it again.