I am getting the following error when I try to build sliding menu project. This project was used in eclipse but I used default import in android studio to get this project.
:slidingMenu:lint FAILED
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':slidingMenu:lint'.
[Ljava/util/HashMap$Entry;
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: 9.59 secs Could not execute build using Gradle
distribution
'http://services.gradle.org/distributions/gradle-1.9-all.zip'.
Running with --stacktrace didn't give any new info.
I've tried adding an ignore as mentioned in this answer - gradle build fails on lint task but that doesn't help.
Did the import create a build.gradle in slidingmenu? That might be the problem if it is not defined as a library:
apply plugin: 'android-library'
I don't have it set up as a library in this way though. I include it in the app's build.gradle:
dependencies {
// ...
compile project(':slidingmenu:library')
}
and in settings.gradle:
include ':slidingmenu:library'
Related
Hello everyone I'm using A.Studio latest version but I need some help.
I already installed Android Studio and I wanted to check it. I created Main.java which is basic code.
And i wrote those codes for check it. I researched many times but i couldn't solve this problem i need help.
public class Main {
public static void main(String[] args){
System.out.println("Testing Java");
}
}
Then I debugged the codes A.S sent me error log. You can see the below.
FAILURE: Build failed with an exception.
* Where:
Initialization script 'C:\Users\canpi\AppData\Local\Temp\Main_main__1.gradle' line: 20
* What went wrong:
A problem occurred configuring project ':app'.
> Could not create task ':app:Main.main()'.
> SourceSet with name 'main' not found.
* 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 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.6.4/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 326ms
Thanks for help, regards.
I am creating a JavaFX app in Java 8.
Java 8 is required for JavaFXports.
I have installed absolutely everything required, but on gradle run, I receive this error:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'MealPlanner'.
> Could not create task ':debug'.
> Unnecessarily replacing a task that does not exist is not supported. Use create() or register() directly instead. You attempted to replace a task named 'debug', but there is no existing task with that name.
* 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 1s
My Gradle.build is as follows:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.3.17'
}
}
apply plugin: 'org.javafxports.jfxmobile'
mainClassName = "src.main.java.MainScreen"
repositories {
jcenter()
}
jfxmobile {
ios {
forceLinkClasses = ['ensemble.**.*']
}
}
Similar questions have been asked and answered.
It's usually a problem with IntelliJ, and it was solved by updating it, OR by deleting the .gradle file and rebuilding.
However, I am using the Atom text editor, and have tried deleting .gradle, but it has not worked.
And, as you can see, I'm not overwriting anything to do with a 'debug' feature.
I've added travis-ci to my github project. Project itself is multi-moduled and consists of :client, :server and :shared.
In the build.gradle of :client module I have organised sourceSets as follows:
sourceSets {
main {
java {
runtimeClasspath += project(":shared").sourceSets.main.java.srcDirs
srcDirs += project(":shared").sourceSets.main.java.srcDirs
}
}
}
Now, when travis-ci runs gradle check it fails with following:
$ gradle server:clean server:check
FAILURE: Build failed with an exception.
* Where:
Build file '/home/travis/build/bduisenov/mockserver/client/build.gradle' line: 55
* What went wrong:
A problem occurred evaluating project ':client'.
> Could not find method main() for arguments [build_ab0sue8nexlysud7wfupu5ddr$_run_closure4_closure12#3fb9a67f] on project ':client'.
* 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: 10.05 secs
The command "gradle server:clean server:check" exited with 1.
Although running locally, I have no issue with it.
Any thoughts on that?
I think that the error simply comes from the gradle version on Travis CI using an old version 2.0. If you generate your gradle wrapper first then Travis CI will use that instead of the built in version - See https://docs.travis-ci.com/user/languages/java#Projects-Using-Gradle. I did try your project locally and there is no problem on Gradle 2.12.
In my android studio project, I imported opencsv-3.6.jar as one of module. However, running unit test got the following error:
Error:FAILURE: Build failed with an exception.
What went wrong:
Task 'testClasses' not found in project ':opencsv-3.6'.
Try:
Run gradle tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
I tried put the exclude in app/build.gradle but failed.
configurations {
testCompile.exclude module: 'opencsv'
}
In opencsv-3.6/build.gradle, it is:
configurations.create("default")
artifacts.add("default", file('opencsv-3.6.jar'))
May I know how to ignore testing this module?
I have a gradle project in big-project/ and a sub-project in big-project/lib/.
In big-project/'s big.project.Main class I import big.project.lib.Utils, which is defined in the big-project/lib/ sub-project.
When I try to run gradle build, this is what happens:
:lib:
compileJava UP-TO-DATE
:lib:processResources UP-TO-DATE
:lib:classes UP-TO-DATE
:lib:jar
:compileJava
big-project/src/main/java/big/project/Main.java:3: error: package big.project.lib not exist
import big.project.lib.Utils;
^
1 error
:compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* 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: 6.243 secs
For some reason, gradle compiles the code of the subproject, and then decides to ignore it. How do I fix that?
These are my gradle files:
big-project/settings.gradle:
include 'lib'
big-project/build.gradle:
evaluationDependsOnChildren()
allprojects {
apply plugin: 'java'
sourceCompatibility = '1.8'
version = '1.0'
group = 'big.project'
}
apply plugin: 'war'
dependencies {
compile project(':lib')
}
big-project/lib/build.gradle is empty
I did study the gradle manual: Chapter 56. Multi-project Builds, but nothing useful came from this.
TL;DR: My big-project/lib/src folder wasn't set up correctly (source code was in the wrong sub directory). As this answer states, Java sources need to be in src/main/java.
Thanks to comments on the question I was able to look in the right place for a solution. As suggested, I looked at a working sample project. As I was using Eclipse, I generated a new Gradle project based on the flat-java-multiproject sample. This enabled me to eliminate my build.gradle files as the source of the error.
Next, I decided to inspect the build/ artifacts of the lib/ project and discovered that the .jar file did not contain any .class files. That explains the compiler error I reported in the question. This caused my to see if all .java sources were in the right place, and as mentioned above, they weren't. Fixing this, fixed the compiler error.
The whole crux was that while I was writing my code in eclipse, all references to the lib project's classes seemed to be found.