I have set up a multi folder project with build.gradle file as shown in https://github.com/Catalysts/catalysts-gradle-plugins/wiki/cat-gwt ,here is /baseDir/build.gradle
apply plugin: 'cat-gwt'
dependencies {
gwtBuild (
[project(path: ':proj1', configuration: 'gwtCompile')]
)
}
subprojects {
// apply plugin: 'xxx'
sourceSets {
main {
java {
srcDir 'src'
}
resources {
srcDir 'src'
}
}
}
}
gwt {
modules {
projectX {
modulename = 'cc.catalysts.gwt.example.projectX'
}
}
}
but while running the gradle build I get the following error.
D:\Spring3HibernateApp>gradle build
:catalysts-gradle-plugins:compileJava UP-TO-DATE
:catalysts-gradle-plugins:compileGroovy UP-TO-DATE
:catalysts-gradle-plugins:processResources UP-TO-DATE
:catalysts-gradle-plugins:classes UP-TO-DATE
:catalysts-gradle-plugins:jar UP-TO-DATE
:catalysts-gradle-plugins:assemble UP-TO-DATE
:catalysts-gradle-plugins:compileTestJava UP-TO-DATE
:catalysts-gradle-plugins:compileTestGroovy UP-TO-DATE
:catalysts-gradle-plugins:processTestResources UP-TO-DATE
:catalysts-gradle-plugins:testClasses UP-TO-DATE
:catalysts-gradle-plugins:test UP-TO-DATE
:catalysts-gradle-plugins:check UP-TO-DATE
:catalysts-gradle-plugins:build UP-TO-DATE
FAILURE: Build failed with an exception.
Where:
Build file 'D:\Spring3HibernateApp\build.gradle' line: 5
What went wrong:
A problem occurred evaluating root project 'Spring3HibernateApp'.
You can't change configuration 'gwtBuild' because it is already resolved!
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: 11.901 secs
please help :(
Related
I am following the quarkus Kubernetes extension guide. https://quarkus.io/guides/deploying-to-kubernetes together with medium article https://genekuo.medium.com/developing-a-rest-service-with-quarkus-and-deploying-to-minikube-c956b9ac900f
Using maven it all works fine. Kubernetes files are generated and I can deploy my app to minikube.
Following the same process with Gradle, it does not generate the Kubernetes files.
gradlew build output:
./gradlew build
Starting a Gradle Daemon, 1 stopped Daemon could not be reused,
use --status for details
No project was detected, skipping generation of kubernetes manifests!
Any help would be appreciated
The build.gradle.kts file"
plugins {
java
id("io.quarkus")
}
repositories {
mavenCentral()
mavenLocal()
}
val quarkusPlatformGroupId: String by project
val quarkusPlatformArtifactId: String by project
val quarkusPlatformVersion: String by project
dependencies {
implementation(enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}"))
implementation("io.quarkus:quarkus-resteasy-jsonb")
implementation("io.quarkus:quarkus-arc")
implementation("io.quarkus:quarkus-resteasy")
implementation("io.quarkus:quarkus-container-image-jib:2.11.2.Final")
implementation("io.quarkus:quarkus-kubernetes:2.11.2.Final")
implementation("io.quarkus:quarkus-minikube:2.11.2.Final")
testImplementation("io.quarkus:quarkus-junit5")
testImplementation("io.rest-assured:rest-assured")
}
group = "com.bspot"
version = "1.0.0-SNAPSHOT"
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.compilerArgs.add("-parameters")
}
Gradle verbose:
./gradlew clean build --console=verbose
> Task :clean
> Task :processResources
> Task :quarkusGenerateCode
> Task :compileJava
> Task :classes
> Task :jar
> Task :quarkusGenerateCodeTests
> Task :compileTestJava
> Task :processTestResources NO-SOURCE
> Task :testClasses
> Task :test
test dir mapping - build\classes\java\test:build\classes\java\main
No project was detected, skipping generation of kubernetes manifests!
> Task :quarkusBuild
> Task :assemble
> Task :check
> Task :build
I'm using Android Studio for the first time and I got the following error after importing the project (previously it was an eclipse project where I had issues too.)
Here is the information given:
Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/home/crash-id/Development/SDK/adt-bundle-linux-x86_64-20140702/sdk/build-tools/21.1.2/dx --dex --no-optimize --output /home/crash-id/AndroidstudioProjects/LocalSin/app/build/intermediates/dex/debug --input-list=/home/crash-id/AndroidstudioProjects/LocalSin/app/build/intermediates/tmp/dex/debug/inputList.txt
Error Code:
2
Output:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/google/ads/AdRequest$ErrorCode;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)
:app:dexDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/google/ads/AdRequest$ErrorCode;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/home/crash-id/Development/SDK/adt-bundle-linux-x86_64-20140702/sdk/build-tools/21.1.2/dx --dex --no-optimize --output /home/crash-id/AndroidstudioProjects/LocalSin/app/build/intermediates/dex/debug --input-list=/home/crash-id/AndroidstudioProjects/LocalSin/app/build/intermediates/tmp/dex/debug/inputList.txt
Error Code:
2
Output:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/google/ads/AdRequest$ErrorCode;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
The app build.gradle is this:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.myapp.test"
minSdkVersion 11
targetSdkVersion 14
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:18.0.0'
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.google.android.gms:play-services:+'
compile files('libs/google-play-services.jar')
compile files('libs/httpcore-4.3.2.jar')
compile files('libs/httpmime-4.3.4.jar')
}
And the project built.gradle is this:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
}
}
allprojects {
repositories {
jcenter()
}
}
Do you have any idea what the problem could be and how can it be solved? A good explanation for the problem would be useful too as I am new to Android Studio. Thanks in advance :)
compile 'com.google.android.gms:play-services:+'
compile files('libs/google-play-services.jar')
I think you should remove 1 of those lines.
cd android/ && ./gradlew clean && cd .. && react-native run-android
I had the Android Studio Error:Execution failed for task ':app:dexDebug' that i solve it by setting multiDexEnabled to true
defaultConfig {
// Enabling multidex support.
multiDexEnabled true
}
Too many library were used in my project so i exceed the 65K methods dex limit imposed by Android for more information see : http://developer.android.com/tools/building/multidex.html
This happens because you are duplicating the library dependency inside of app build.gradle in android studio.
Android Studio automatically adds the dependencies for all the files in the libs folder by using
compile fileTree(dir: 'libs', include: ['*.jar'])
or in your specific case the dependency is added using
compile files('libs/google-play-services.jar')
^ Now when you try to add the dependency again by using
compile 'com.google.android.gms:play-services:+'
you get the error.
SOLUTION
Remove all duplicate dependencies added inside the "app build.gradle" and you should be good to go.In your case remove
compile 'com.google.android.gms:play-services:+'
avoid to include whole gms library:
compile 'com.google.android.gms:play-services:+'
Instead, just use required components in this way:
compile 'com.google.android.gms:play-services-ads:8.3.0'
compile 'com.google.android.gms:play-services-analytics:8.3.0'
compile 'com.google.android.gms:play-services-gcm:8.3.0'
Ensure that the Package names are not duplicated across the projects being compiled
In #Drivers' answer, it is pointed out that in a given project, there should not be multiple dependencies that have the same namespace. In the case above, the Google Play Services library had been included twice, and thus caused a package name conflict.
The same can also happen across multiple modules (apps, libraries etc.) in the same project. So, ensure that for each AndroidManifest.xml file, the package name is unique across all modules:-
AndroidManifest.xml:
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="this.must.be.unique.across.modules">
I had the below code on gradle file and same error.
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.google.android.gms:play-services-ads:8.3.0'
}
dependencies {
compile 'com.android.support:design:23.+'
}
dependencies {
compile 'com.android.support:design:23.+'
}
dependencies {
compile 'com.android.support:design:23.+'
}
Removed those last 3 dependencies and now its working!
delete all files in c:\users\<username>\.gradle\caches\transforms-2\files-2.1\
Enjoy the command flutter run
I tried to apply plugin directly from GitHub repo e.g. as given below
apply from 'https://github.com/gradle/gradle-hello-world-plugin' but on running
./gradlew codeLines
It gives me error as
* Where:
Script 'https://github.com/SurpSG/code-lines-counter-gradle-plugin' line: 7
* What went wrong:
Could not compile script 'https://github.com/SurpSG/code-lines-counter-gradle-plugin'.
> startup failed:
script 'https://github.com/SurpSG/code-lines-counter-gradle-plugin': 7: unexpected token: < # line 7, column 1.
<!DOCTYPE html>
^
How can I directly apply plugin from remote git repo?
The plugin is automatically published to jitpack.
You could apply the plugin in the next way:
buildscript {
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
classpath 'com.github.SurpSG:code-lines-counter-gradle-plugin:0.0.1'
}
}
apply plugin: 'com.github.code-lines'
Note! code-lines-counter-gradle-plugin is sample project created as a part of tutorial.
I don't recommend to use it because it far from production ready
I don't think it's possible. The closest think you can do is clone the plugin, build it and point to it
buildscript {
repositories {
[...]
}
dependencies {
classpath files('relative/path/to/gradle-hello-world-plugin.jar')
}
}
apply plugin: org.gradle.plugin.HelloWorldPlugin
Source : https://stackoverflow.com/a/35472676/2003986
I'm using this package to scan qr code. But I upgrade to 3.x version, have error:
[ +2 ms] FAILURE: Build failed with an exception.
[ +2 ms] * What went wrong:
[ ] Some problems were found with the configuration of task ':barcode_scan:generateDebugProto'.
[ ] > Directory '<projectName>\build\barcode_scan\extracted-protos\main' specified for property '$4' does not exist.
[ +19 ms] * Try:
[ +17 ms] 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.
I try add main folder to extracted-protos but when I run app, this folder
is lost.
After spending 2 days trying to fix it. Finally I figured out how to:
Go to android folder > build.gradle file. After add line:
buildscript {
ext.kotlin_version = '1.3.61'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.12' //add this line
}
}
And It work.
My gradle version is 2.2.1.
I am trying to use the artifactory plugin in gradle (apply plugin: 'artifactory')
This is my code:
buildscript {
repositories {
maven {
url 'http://172.14.3.93/artifactory/plugins-release'
}
}
dependencies {
classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '2.0.9')
}
}
allprojects {
apply plugin: 'artifactory'
}
artifactory {
contextUrl = "${artifactory_contextUrl}" //The base Artifactory URL if not overridden by the publisher/resolver
publish {
repository {
repoKey = 'libs-release-local'
maven = true
}
}
resolve {
repository {
repoKey = 'libs-release'
maven = true
}
}
}
When i run gradle build, this is what i get:
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Workspace\GradleConfiguration\build.gradle' line: 100
* What went wrong:
A problem occurred evaluating root project 'GradleConfiguration'.
> Failed to apply plugin [id 'artifactory']
> Could not find method add() for arguments [artifactoryPublish, class org.jfrog.gradle.plugin.artifactory.extractor.BuildInfoTask] on task set.
* Try:
Run with --info or --debug option to get more log output.
Also, when i delete all the code that is related to the artifactory and leave only apply plugin: 'artifactory', i get this error:
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\OnRights_Workspace\GradleConfiguration\build.gradle' line: 86
* What went wrong:
A problem occurred evaluating root project 'GradleConfiguration'.
> Failed to apply plugin [id 'artifactory']
> Plugin with id 'artifactory' not found.
* Try:
Run with --info or --debug option to get more log output.
Your plugin version is too old. Try to use the latest (3.1.1).
The buildscript block tells Gradle where it should be looking for plugins. You've told it that it should only search at http://172.14.3.93/artifactory/plugins-release.
Are you 100% sure that the "artifactory" plugin is actually hosted there?
If you put jcenter in there, like the instructions say, does it work better?
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.1.0"
}
}
apply plugin: "com.jfrog.artifactory"