Intellij idea error when checking hyperskill project - java

I am currently working on Hyperskill (JetBrains academy) on Java Backend Developer track. Every project that I try to check from the Intellij Idea IDE gives me this error:
Failed to launch checking
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':Simple_Search_Engine-task:compileTestJava'.
Could not resolve all files for configuration ':Simple_Search_Engine-task:testCompileClasspath'.
Could not find com.github.hyperskill:hs-test:release-SNAPSHOT.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/com/github/hyperskill/hs-test/release-SNAPSHOT/maven-metadata.xml
- https://repo.maven.apache.org/maven2/com/github/hyperskill/hs-test/release-SNAPSHOT/hs-test-release-SNAPSHOT.pom
- https://jitpack.io/com/github/hyperskill/hs-test/release-SNAPSHOT/maven-metadata.xml
- https://jitpack.io/com/github/hyperskill/hs-test/release-SNAPSHOT/hs-test-release-v8-g6845035-132.pom
Required by:
project :Simple_Search_Engine-task
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 3s
Task :Simple_Search_Engine-task:compileJava UP-TO-DATE
Task :Simple_Search_Engine-task:processResources NO-SOURCE
Task :Simple_Search_Engine-task:classes UP-TO-DATE
Task :util:compileJava NO-SOURCE
Task :util:processResources NO-SOURCE
Task :util:classes UP-TO-DATE
Task :util:compileTestJava NO-SOURCE
Task :util:processTestResources NO-SOURCE
Task :util:testClasses UP-TO-DATE
Task :Simple_Search_Engine-task:compileTestJava FAILED
2 actionable tasks: 1 executed, 1 up-to-date
My project: https://drive.google.com/drive/folders/1xEV47YXdkVRUfB0JPSEkmcPtBbb5rbvJ?usp=sharing
Project from hyperskill: https://hyperskill.org/projects/66?track=12
I tried reinstalling the IDE or changing the project that I am working but the same errors. When I am uploading the solve directly on hyperskill website it works perfectly fine.
Here is also a video if it is more helpful: https://youtu.be/nvrpHuVq44A
Please help me! :D

Go to the build.gradle file for this project and replace the following line:
'com.github.hyperskill:hs-test:release-SNAPSHOT'
With
'com.github.hyperskill:hs-test:master-SNAPSHOT'
It seems that the release branch has an error, so change it to master.
Then, open up IntelliJ and restart Gradle.

Could you please select JDK 17 as Gradle JVM in Settings/Preferences | Build, Execution, Deployment | Build Tools | Gradle?
After that, please ensure that JDK 17 is selected as Project SDK in File | Project Structure.

Related

Cordova run android keeps on failing

I'm building my first cordova app and I'm trying to install it on my Android phone to check if everything is working.
But I keep getting the same error message over and over again:
C:\LesCordova\project_cordova>cordova build android
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=C:\Android-SDK (recommended setting)
ANDROID_HOME=undefined (DEPRECATED)
Using Android SDK: C:\Android-SDK
Subproject Path: CordovaLib
Subproject Path: app
Task :app:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeDebugResources'.
This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.properties file and retry.
The following AndroidX dependencies are detected: androidx.versionedparcelable:versionedparcelable:1.0.0, androidx.fragment:fragment:1.0.0, androidx.slidingpanelayout:slidingpanelayout:1.0.0, androidx.core
:core:1.0.0, androidx.customview:customview:1.0.0, androidx.swiperefreshlayout:swiperefreshlayout:1.0.0, androidx.interpolator:interpolator:1.0.0, androidx.loader:loader:1.0.0, androidx.drawerlayout:drawerla
yout:1.0.0, androidx.viewpager:viewpager:1.0.0, androidx.collection:collection:1.0.0, androidx.localbroadcastmanager:localbroadcastmanager:1.0.0, androidx.lifecycle:lifecycle-common:2.0.0, androidx.arch.core
:core-common:2.0.0, androidx.annotation:annotation:1.1.0, androidx.legacy:legacy-support-core-ui:1.0.0, androidx.lifecycle:lifecycle-livedata:2.0.0, androidx.lifecycle:lifecycle-viewmodel:2.0.0, androidx.lif
ecycle:lifecycle-livedata-core:2.0.0, androidx.arch.core:core-runtime:2.0.0, androidx.legacy:legacy-support-core-utils:1.0.0, androidx.documentfile:documentfile:1.0.0, androidx.cursoradapter:cursoradapter:1.
0.0, androidx.lifecycle:lifecycle-runtime:2.0.0, androidx.coordinatorlayout:coordinatorlayout:1.0.0, androidx.asynclayoutinflater:asynclayoutinflater:1.0.0, androidx.print:print:1.0.0
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 1s
7 actionable tasks: 1 executed, 6 up-to-date
Command failed with exit code 1: C:\LesCordova\project_cordova\platforms\android\gradlew cdvBuildDebug -b C:\LesCordova\project_cordova\platforms\android\build.gradle
I already tried to change the android.useAndroidX property to true, but it changes back to false.
I already deleted the platform/android directory.
I realy hope someone knows what I'm doing wrong, because I'm running out of time...
Thank you!
Greetings Joyce

when create apk file error found ':app:mergeDebugResources'

When I am making apk file from my android for the first time.
I have this error.Can anyone help me?
**Execution failed for task ':app:mergeDebugResources'.
Could not resolve all files for configuration ':app:_internal_aapt2_binary'.
Could not resolve com.android.tools.build:aapt2:3.6.2-6040484.
Required by:
project :app
No cached version of com.android.tools.build:aapt2:3.6.2-6040484 available for offline mode.
No cached version of com.android.tools.build:aapt2:3.6.2-6040484 available for offline mode.
* 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 4s
5 actionable tasks: 5 executed**
This error usually occurs due to the Gradle running in offline mode:-
Disable the offline mode of Gradle by going to File - Project Settings - Build, Execution, Deployment - Gradle - Remove --offline in Command Line options.(Or, simply click the -//- icon in the Gradle window.)
Then, connect to the internet and run Gradle build.
After the build has run once, you can enable the offline mode again.

Error while performing push command in git

Using the guide https://www.youtube.com/watch?v=7RHYDNSRSOs I want to deploy the application to Heroku. However, git push heroku master throws an error:
:compileJava NO-SOURCE
:processResources NO-SOURCE
:classes UP-TO-DATE
:findMainClass
:jar
:bootRepackage FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':bootRepackage'.
> Unable to find main class
* 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.555 secs
! ERROR: Failed to run Gradle!
We're sorry this build is failing. If you can't find the issue in application
code, please submit a ticket so we can help: https://help.heroku.com
You can also try reverting to the previous version of the buildpack by running:
$ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-gradle#previous-version
Thanks,
Heroku
! Push rejected, failed to compile Gradle app.
! Push failed
The project normally works during compilation in IntelliJ. They work without a problem.

Error building boofcv calibration app with gradle

I've followed build instructions from here:
https://boofcv.org/index.php?title=Tutorial_Camera_Calibration
and get this strange error message:
C:\boofcv\applications>gradle applicationsJar
Skipping integration/android because ANDROID_HOME has not been set! See integration/android/readme.txt
Skipping integration/boofcv-openkinect because boofcv-openkinect/libfreenect is missing! See integration/openkinect/readme.txt
Parallel execution is an incubating feature.
FAILURE: Build failed with an exception.
* What went wrong:
Failed to capture snapshot of input files for task ':applications:applicationsJar' property 'rootSpec$1$1$2$1' during up-to-date check.
> A Jar can only accept a file or directory that exists: C:\boofcv\applications\build\osgi-classes
* 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
BUILD FAILED in 10s
38 actionable tasks: 10 executed, 28 up-to-date
my boofcv version is 0.27.

Gradle build fails with NoClassDefFoundError for sun.awt.X11GraphicsEnvironment in :mergeDebugResources

I always get this error when I try to build microG:
$ ./gradlew build
Skipping debug jar:microg-ui-tools:preBuild UP-TO-DATE
:microg-ui-tools:preDebugBuild UP-TO-DATE
:microg-ui-tools:checkDebugManifest
:microg-ui-tools:preDebugAndroidTestBuild UP-TO-DATE
:microg-ui-tools:preDebugUnitTestBuild UP-TO-DATE
:microg-ui-tools:preReleaseBuild UP-TO-DATE
:microg-ui-tools:preReleaseUnitTestBuild UP-TO-DATE
:microg-ui-tools:prepareComAndroidSupportAnimatedVectorDrawable2531Library
:microg-ui-tools:prepareComAndroidSupportAppcompatV72531Library
:microg-ui-tools:prepareComAndroidSupportPreferenceV142531Library
:microg-ui-tools:prepareComAndroidSupportPreferenceV72531Library
:microg-ui-tools:prepareComAndroidSupportRecyclerviewV72531Library
:microg-ui-tools:prepareComAndroidSupportSupportCompat2531Library
:microg-ui-tools:prepareComAndroidSupportSupportCoreUi2531Library
:microg-ui-tools:prepareComAndroidSupportSupportCoreUtils2531Library
:microg-ui-tools:prepareComAndroidSupportSupportFragment2531Library
:microg-ui-tools:prepareComAndroidSupportSupportMediaCompat2531Library
:microg-ui-tools:prepareComAndroidSupportSupportV42531Library
:microg-ui-tools:prepareComAndroidSupportSupportVectorDrawable2531Library
:microg-ui-tools:prepareComTakisoftFixPreferenceV725310Library
:microg-ui-tools:prepareDebugDependencies
:microg-ui-tools:compileDebugAidl UP-TO-DATE
:microg-ui-tools:compileDebugNdk UP-TO-DATE
:microg-ui-tools:compileLint UP-TO-DATE
:microg-ui-tools:copyDebugLint UP-TO-DATE
:microg-ui-tools:compileDebugRenderscript UP-TO-DATE
:microg-ui-tools:generateDebugBuildConfig UP-TO-DATE
:microg-ui-tools:generateDebugResValues UP-TO-DATE
:microg-ui-tools:generateDebugResources UP-TO-DATE
:microg-ui-tools:mergeDebugResources
java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
:microg-ui-tools:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':microg-ui-tools:mergeDebugResources'.
> java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
* 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: 2.932 secs
This is on a headless server that doesn't even have an X server installed! This happens for release (except with mergeReleaseResources) as well. I tried running with --info and --debug but it didn't give me anything useful. I've also tried switching to use Oracle's JDK instead of OpenJDK and installing a local X server on the machine building but that didn't change anything either. This is on a freshly cloned copy of the repo, although I don't think the error is specific to microG.
Here are my results running ./gradlew build --stacktrace: https://gist.github.com/milkey-mouse/cb6b75b5116cf369603dec46e214e914
You can try adding -Djava.awt.headless=true to your jvmargs in gradle.properties file:
org.gradle.jvmargs=-Djava.awt.headless=true
Also please take a look at example here.
Here is the similar question, but not related to Gradle.

Categories