I'm getting following exception while building Javafx Application into Android.
error: Error: No resource found that matches the given name (at 'icon' with value '#mipmap/ic_launcher').
:processAndroidDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processAndroidDebugResources'.
> Process 'command 'E:\Android\android-sdk\build-tools\23.0.1\aapt.exe'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1 mins 24.005 secs
Build failure (see the Notifications window for stacktrace): gradle :android
and I'm had installed android sdk and pointed to ANDROID_HOME. this my build script in build.gradle.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.0.0-b4'
}
}
apply plugin: 'org.javafxports.jfxmobile'
repositories {
jcenter()
}
mainClassName = 'com.javafxport.JavaFXPort'
jfxmobile {
android {
manifest = 'src/android/AndroidManifest.xml'
}
ios {
infoPList = file('src/ios/Default-Info.plist')
}
}
I'm trying to install very simple javafx application into my android device. please help me with advance.
First of all, check that your Gluon plugin for NetBeans is updated. Currently you can use version 1.0.2, that will provide you with a more updated version of the plugin:
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.0.0-b9'
}
Actually, according to this, you can update that manually to:
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.0.1'
}
Now check on Android SDK, using SDK Manager, that you have installed sdks version 22, and building tools version 22, but not version 23, which is for the new Android M, not supported yet by JavaFXPorts.
Related
I get an error in my android>build.gradle file.
The build.gradle file:
buildscript {
ext.kotlin_version = '1.6.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.13'
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
The error message:
Could not run phased build action using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-7.4-all.zip'.
org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project 'android'.
A problem occurred configuring root project 'android'.
A problem occurred evaluating root project 'android'.
A problem occurred configuring project ':app'.
A problem occurred evaluating project ':app'.
Failed to apply plugin 'com.android.internal.application'.
Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
Update: When checking my Java version:
$ ./gradlew --version
------------------------------------------------------------
Gradle 7.4
------------------------------------------------------------
Build time: 2022-02-08 09:58:38 UTC
Revision: f0d9291c04b90b59445041eaa75b2ee744162586
Kotlin: 1.5.31
Groovy: 3.0.9
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 11.0.16 (Oracle Corporation 11.0.16+11-LTS-199)
OS: Windows 11 10.0 amd64
The error is marked at the first line on buildscript.
Any idea what this is? It says that my java version is wrong but it have worked all the time and in all my other app it still works. Very strange to me.
I use VScode if that makes any difference.
vscode does not support older versions of jdk in some functions, switch to a higher version.
It is recommended to use jdk17, which can be downloaded from the Configure Java Runtime page.
This bug resolved itself when I moved location of the flutter project. I guess something that a restart or flutter clean couldn’t reach got rebuilt when you move the location of the project. (Moved it to another folder)
I am a beginner with Gradle projects and am struggling to build a project.
I am receiving this error when running gradle -PmainClass run:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not resolve com.google.guava:guava:28.2-jre.
Required by:
project :
> Could not resolve com.google.guava:guava:28.2-jre.
> Could not get resource 'https://jcenter.bintray.com/com/google/guava/guava/28.2-jre/guava-28.2-jre.pom'.
> Could not GET 'https://jcenter.bintray.com/com/google/guava/guava/28.2-jre/guava-28.2-jre.pom'.
> sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: timestamp check failed
* 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 11s
1 actionable task: 1 executed
I am trying to run a Java application here by following the first example in this post.
For clarification, I do have an internet connection. I'm wondering if there is some sort of certificate I need.
Here is my build.gradle:
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* User Manual available at https://docs.gradle.org/6.3/userguide/tutorial_java_projects.html
*/
plugins {
// Apply the java plugin to add support for Java
id 'java'
// Apply the application plugin to add support for building a CLI application.
id 'application'
}
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
dependencies {
// This dependency is used by the application.
implementation 'com.google.guava:guava:28.2-jre'
implementation files('./lib/jython-standalone-2.7.0.jar')
// Use JUnit test framework
testImplementation 'junit:junit:4.12'
}
application {
// Define the main class for the application.
mainClassName = 'Zumi.App'
}
Any help is appreciated. Thanks!
Add mavenCentral() to your repositories block,
plugins {
// Apply the java plugin to add support for Java
id 'java'
// Apply the application plugin to add support for building a CLI application.
id 'application'
}
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
mavenCentral()
}
dependencies {
// This dependency is used by the application.
implementation 'com.google.guava:guava:28.2-jre'
implementation files('./lib/jython-standalone-2.7.0.jar')
// Use JUnit test framework
testImplementation 'junit:junit:4.12'
}
application {
// Define the main class for the application.
mainClassName = 'Zumi.App'
}
To learn about SonarQube I'm using the open-source app called Conversations and I'm trying to run SonarScanner with gradle. I have directly cloned the project from git and added the following configuration in the build.grade:
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.8"
}
}
apply plugin: "org.sonarqube"
And when I run the command "gradle sonarqube" in the root folder I get the following error:
Execution failed for task ':compileConversationsPlaystoreSystemDebugJavaWithJavac'.
I don't understand how to run sonarscanner with gradle and would appreciate if someone could point me to the right direction.
I am quite new to gradle world and I am trying to build a java project and publish the resulting artifacts to the repository.
As part of the build, I am getting the below error message, some pointers on how to fix the below issue would be helpful.
Gradle Build:
$ gradle build --info
Initialized native services in: /var/lib/jenkins/.gradle/native
The client will now receive all logging from the daemon (pid: 4587). The daemon log file: /var/lib/jenkins/.gradle/daemon/4.9/daemon-4587.out.log
Starting 42nd build in daemon [uptime: 4 hrs 26 mins 46.465 secs, performance: 99%]
Using 4 worker leases.
Starting Build
Settings evaluated using settings file '/var/lib/jenkins/gradle_projects/settings.gradle'.
Projects loaded. Root project using build file '/var/lib/jenkins/gradle_projects/build.gradle'.
Included projects: [root project 'hello-world']
> Configure project :
Evaluating root project 'hello-world' using build file '/var/lib/jenkins/gradle_projects/build.gradle'.
FAILURE: Build failed with an exception.
* Where:
Build file '/var/lib/jenkins/gradle_projects/build.gradle' line: 32
* What went wrong:
A problem occurred evaluating root project 'hello-world'.
> Could not find method artifactory() for arguments [build_en65a4pmtkipo6cwvlcm8w7ky$_run_closure3#3ea141a7] on root project 'hello-world' of type org.gradle.api.Project.
* Try:
Run with --stacktrace option to get the stack trace. Run with --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 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.9/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 0s
This error is because you are trying to configure the Artifactory plugin ( artifactory block) but you did not apply the Artifactory plugin to your project.
Try to import the plugin as follow:
buildscript {
// EDIT
repositories {
// ...
jcenter()
}
dependencies {
// ...
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:latest.release" // <- this line is missing in your script
}
}
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: "com.jfrog.artifactory" // <-- this one is missing in your script
Refer to the plugin official documentation for full configuration examples : https://www.jfrog.com/confluence/display/RTF/Gradle+Artifactory+Plugin
Trying to build my project with gradle 2.13.
Getting Error:
MUSGM186035-835:c gm$ gradle build
Version suffix : -6
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/gm/IdeaProjects/repo/a/b/c/build.gradle' line: 2
* What went wrong:
A problem occurred evaluating project ':b:c:QGInitiator'.
> Failed to apply plugin [class 'org.gradle.api.plugins.scala.ScalaBasePlugin']
> A dependency must not be empty
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or
--debug option to get more log output.
BUILD FAILED
Total time: 8.397 secs
My build.gradle file looks like,
apply plugin: 'java'
apply plugin:'scala'//Line with error
ourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile "org.scala-lang:scala-library:2.11.1"
}
This project is part of another project which has other gradle files. But I am not buling the parent project. Not sure what is happening with my dependency.
Stacktrace:
Caused by: org.gradle.api.InvalidUserDataException: A dependency must not be empty
at org.gradle.api.internal.tasks.DefaultTaskDependency.addValue(DefaultTaskDependency.java:122)
at org.gradle.api.internal.tasks.DefaultTaskDependency.add(DefaultTaskDependency.java:115)
at org.gradle.api.internal.AbstractTask$11.run(AbstractTask.java:323)
at org.gradle.api.internal.tasks.TaskMutator.mutate(TaskMutator.java:37)
at org.gradle.api.internal.AbstractTask.dependsOn(AbstractTask.java:321)
at org.gradle.plugins.ide.idea.IdeaPlugin$_configureForScalaPlugin_closure8.doCall(IdeaPlugin.groovy:229)
at org.gradle.plugins.ide.idea.IdeaPlugin$_configureForScalaPlugin_closure8.call(IdeaPlugin.groovy)
at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:67)
at org.gradle.internal.Actions$FilteredAction.execute(Actions.java:205)
at org.gradle.listener.ActionBroadcast.execute(ActionBroadcast.java:39)
at org.gradle.api.internal.DefaultDomainObjectCollection.doAdd(DefaultDomainObjectCollection.java:165)
at org.gradle.api.internal.DefaultDomainObjectCollection.add(DefaultDomainObjectCollection.java:159)
at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:142)
Try applying the idea plugin to the root plugin. I'm not exactly sure what's going on, but that should solve the issue.