ERROR: Unable to find the resource: /META-INF/BenchmarkList when running JMH with gradle - gradle

I want to benchmark my application using JMH.
I am using JMH with gradle as build tool.
The github repository is here.
But whenever I run the application com.demo.aerospike.JMHAerospikeSpringData I get below error.
$ gradle run
> Configure project :
Task :jmh Last added: null
> Task :run
JMHAerospikeSpringData is running ...
Exception in thread "main" java.lang.RuntimeException: ERROR: Unable to find the resource: /META-INF/BenchmarkList
at org.openjdk.jmh.runner.AbstractResourceReader.getReaders(AbstractResourceReader.java:98)
at org.openjdk.jmh.runner.BenchmarkList.find(BenchmarkList.java:122)
at org.openjdk.jmh.runner.Runner.internalRun(Runner.java:256)
at org.openjdk.jmh.runner.Runner.run(Runner.java:206)
at com.demo.aerospike.JMHAerospikeSpringData.main(JMHAerospikeSpringData.java:47)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':run'.
> Process 'command
'/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/bin/java'' 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.
I tried different solutions in other stackoverflow but couldn't help.
Any idea what I'm missing.

I have resolved this problem by adding this dependency to my project:
testAnnotationProcessor "org.openjdk.jmh:jmh-generator-annprocess:$jmhVersion"
next to
testImplementation "org.openjdk.jmh:jmh-core:$jmhVersion"

implementation 'org.openjdk.jmh:jmh-core:1.33'
annotationProcessor 'org.openjdk.jmh:jmh-generator-annprocess:1.33'
just like lombok

Try running without gradle daemon:
gradle --stop
gradle --no-daemon jmh

Not sure how is your project setup like because I can't find com.demo.aerospike.JMHAerospikeSpringData in your repo. Maybe you want to check this project out to get some ideas to try.
https://github.com/eugenp/tutorials/blob/master/core-java-modules/core-java-collections-maps-3/src/main/java/com/baeldung/map/concurrenthashmap/MapPerformanceComparison.java

Related

Execution failed for task ':ofbiz --load-data' while running OfBiz

FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':ofbiz --load-data'.
Process 'command 'C:\Program Files\Java\jdk-17.0.2\bin\java.exe'' finished with non-zero exit value 1
Try:
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':ofbiz --load-data'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:147)
at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:282)
when i am trying build using gradle facing issue, any help appreciated.
`
Your issue is not clear. In windows devices try gradlew cleanAll loadAll ofbiz command to load data and run ofbiz. If your issue is due to java version, try Java 1.8 version.
Visit below link of OFBiz development guide for more help
https://cwiki.apache.org/confluence/display/OFBIZ/OFBiz+Tutorial+-+A+Beginners+Development+Guide

"Could not find method platform()" after Firestore upgrade for Flutter project

I just upgraded to Firestore 0.14.4 from 0.13.* for my VSCode/Flutter project and am now getting the build errors below.
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\projects\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.14.4\android\build.gradle' line: 54
* What went wrong:
A problem occurred evaluating project ':cloud_firestore'.
> Could not find method platform() for arguments [com.google.firebase:firebase-bom:25.12.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
* 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 2s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
My build.gradle file has the line classpath 'com.android.tools.build:gradle:3.3.2 which makes me think my gradle needs upgrading? So, I did the usual Google search but it didn't seem straightforward to upgrade gradle (though I'm sure I missed something). Does it sound like I need to upgrade and, if so, how do I do that?

Minecraft Forge Gradle with VSCode

I am trying to create a Minecraft Mod using VSCode as this is my main editor for school, but when I try to run the command gradlew genVSCodeRun I get the follwoing output that says successful, but also "Could not resolve: net.minecraftforge:forge:1.15.2-31.1.0_mapped_snapshot_20190719-1.14.3". When I then run gradlew build, the following it output:
Task :compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':compileClasspath'.
Could not find net.minecraftforge:forge:1.15.2-31.1.0_mapped_snapshot_20200119-1.14.3.
Searched in the following locations:
- file:/C:/Users/eabla/.gradle/caches/forge_gradle/bundeled_repo/net/minecraftforge/forge/1.15.2-31.1.0_mapped_snapshot_20200119-1.15/forge-1.15.2-31.1.0_mapped_snapshot_20200119-1.14.3.pom
- file:/C:/Users/eabla/.gradle/caches/forge_gradle/bundeled_repo/net/minecraftforge/forge/1.15.2-31.1.0_mapped_snapshot_20200119-1.15/forge-1.15.2-31.1.0_mapped_snapshot_20200119-1.14.3.jar
- https://files.minecraftforge.net/maven/net/minecraftforge/forge/1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3/forge-1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3.pom
- https://files.minecraftforge.net/maven/net/minecraftforge/forge/1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3/forge-1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3.jar
- https://libraries.minecraft.net/net/minecraftforge/forge/1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3/forge-1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3.jar
- https://repo.maven.apache.org/maven2/net/minecraftforge/forge/1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3/forge-1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3.pom
- https://repo.maven.apache.org/maven2/net/minecraftforge/forge/1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3/forge-1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3.jar
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 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 40s
1 actionable task: 1 executed
Any idea what this could be? I have done a fresh install of java JDK and JRE as well as a fresh install of the Forge MDK.
Your Forge Library is missing. Run the command gradlew eclipse after navigating into your project directory. It may take some time but it will surely fix it. :D
Make sure you have the JDK (java development kit https://www.oracle.com/java/technologies/javase-jdk8-downloads.html) installed not just the JRE

Error when build react native for task ':app:prepareComAndroidSupportSupportV42301Library'

I'm new react-native developer. When i run react native in windows with "react-native run-android", it return error :
Starting JS server...
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72301Library
:app:prepareComAndroidSupportSupportV42301Library FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:prepareComAndroidSupportSupportV42301Library'.
Could not expand ZIP 'C:\Android\sdk\extras\android\m2repository\com\android\support\support-v4\23.0.1\support-v4-23.0.1.aar'.
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: 15 mins 33.768 secs
Can you help me fix this problem? thank!
I had the exact same issue and it turns out it's got to do with the google play-services-analytics version.
and by adding the following code to the build.gradle file I was able to get rid of the error.
compile("com.google.android.gms:play-services-analytics:8.3.0"){
force = true
}
add it at the top of the dependencies curly braces.
so that it looks like this.
dependencies { compile("com.google.android.gms:play-services- analytics:8.3.0"){
force = true
}
//the rest of the dependencies follow
Go t the page below for a better and more detailed explanation
https://github.com/idehub/react-native-google-analytics-bridge/issues/31

AndroidStudio Unambiguous Errors

I've been using AndroidStudio and it has a few inconsistencies but it's very good already.
I've been compiling and running my app fine and then suddenly (after doing something innocuous) it's throwing up the below error but i cannot find out the issue. Does anyone have any ideas how to find out the errors?
Compilation completed with 2 errors and 0 warnings in 46 sec
2 errors
0 warnings
Gradle:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':Candle:compileDebug'.
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.
If nothing has really changed in your project settings, then I'd check the log (Help | Show log in Files/Explorer/Finder) for clues. Most likely, the Gradle daemon died, and a rebuild should fix it.
If that doesn't help, then your only option to find more info is to do a command line build. Go to the root of your project, and do:
./gradlew assemble
The best way I've found to get to the errors is to run gradle compile and/or package from the command line. In the root of your project run:
gradlew compileDebug
AND / OR
gradlew packageDebug
This will give you command line output for your errors
It also sometimes helps to run a gradle clean before running builds:
gradle clean
Hope this helps

Resources