Learning Gradle but getting the following error on workstation - java

I am learning gradle and I am having issues..
I am using https://github.com/spring-guides/gs-gradle.git as my learning project and I goto
cd in gs-gradle/complete
then I run gradle run and I am getting the following error:
$ gradle build
:compileJava
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':compile'.
> Could not resolve joda-time:joda-time:2.2.
Required by:
:complete:unspecified
> Could not GET 'https://repo1.maven.org/maven2/joda-time/joda-time/2.2/joda-
time-2.2.pom'.
> peer not authenticated
* 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.452 secs

Use the latest version of joda-time. The current version is 2.10.5.
In build.gradle change the dependency to point to compile "joda-time:joda-time:2.10.5"

Related

FAILURE: Build failed with an exception. * Where: Build file 'C:\Users\dell\AndroidStudioProjects\attendance_manager\android\build.gradle' line: 26

FAILURE: Build failed with an exception. * Where: Build file 'C:\Users\dell\AndroidStudioProjects\attendance_manager\android\build.gradle' line: 26 * What went wrong: A problem occurred evaluating root project 'android'. > A problem occurred configuring project ':app'. > Could not open proj generic class cache for build file 'C:\Users\dell\AndroidStudioProjects\attendance_manager\android\app\build.gradle' (C:\Users\dell.gradle\caches\7.4\scripts\6kf7hlj2razsy2gytva6h994n). > BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 63 * 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.
I tried to remove invalidate caches , after that i restart my computer , after that i unistall my flutter app in my device but, nothig happen.
Check your java version , if your Java version is 18,19 or 20 delete your latest version and try to use Java-8 or Java-11.
-> I tried Java version 11 , My error was solve

UDF creation on Ksql db

Trying to create UDF on KSQL on linux servers using gradle. We are using Confluent 7.1.1 and Gradle 6.3. Using the mentioned steps in the link to create UDF.
https://developer.confluent.io/tutorials/udf/ksql.html
While running the ./gradlew build we are facing the below error.
Task :compileJava FAILED
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 io.confluent.ksql:ksql-udf:5.4.7.
Required by:
project :
> Could not resolve io.confluent.ksql:ksql-udf:5.4.7.
> Could not get resource 'https://packages.confluent.io/maven/io/confluent/ksql/ksql-udf/5.4.7/ksql-udf-5.4.7.pom'.
> Could not GET 'https://packages.confluent.io/maven/io/confluent/ksql/ksql-udf/5.4.7/ksql-udf-5.4.7.pom'.
> Connection reset
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 832ms

Could not resolve all files for configuration ':app:androidJdkImage

I am trying to build flutter apk on debug mode from android studio.
Flutter run
I get this error:
Launching lib/main.dart on sdk gphone x86 arm in debug mode...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
Could not resolve all files for configuration ':app:androidJdkImage'.
Failed to transform core-for-system-modules.jar to match attributes {artifactType=_internal_android_jdk_image, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
> Execution failed for JdkImageTransform: /Users/mac/Library/Android/sdk/platforms/android-30/core-for-system-modules.jar.
> jlink executable /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/jlink does not exist.
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 20s
Exception: Gradle task assembleDebug failed with exit code 1
I solved this issue by downloading the required NDK side by side
package as shown in this screenshot for the required SDK platform.
If you keep getting errors after doing this, please share error logs or screenshots. Thanks.
In my case, I only need update Android Studio to newer version and it's working normally again.

I am new to flutter app development. Got handover of the flutter project and tried to run, but getting Build Failed Exception by terminal command

My app was working fine and all of a sudden this error popped up and no longer works
Launching lib\main.dart on Redmi Note 9S in debug mode...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugResources'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
C:\Users\abumo.gradle\caches\transforms-2\files-2.1\e8b87230ecc8f4137f972d2f499610c1\play-services-ads-lite-20.0.0\AndroidManifest.xml:27:5-43:15: AAPT: error: unexpected element found in .
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 2m 46s
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin apple_sign_in...
Running Gradle task 'assembleAarRelease'...
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'apple_sign_in'.
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
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 5s
Exception: The plugin apple_sign_in could not be built due to the issue above.
pleas help me

npm run android in react native giving build error

After running react-native run-android:
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'pusher'.
Could not resolve all dependencies for configuration ':classpath'.
Could not download protobuf-java.jar (com.google.protobuf:protobuf-java:2.5.0)
Could not get resource 'https://jcenter.bintray.com/com/google/protobuf/protobuf-java/2.5.0/protobuf-java-2.5.0.jar'.
Could not GET 'https://jcenter.bintray.com/com/google/protobuf/protobuf-java/2.5.0/protobuf-java-2.5.0.jar'.
sun.security.validator.ValidatorException: No trusted certificate found
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
I have installed SDK tools,have followed react native documentation properly,but still have hit a snag.
I am using Ubuntu 16.
Go to your build.gradle file in [your project name]\android\app and under "dependencies", change the 'com.android.support:appcompat-v7:23.0.1' dependency to 23.0.0.

Categories

Resources