Fail to run desktop app with desktop:run LIBGDX - java

I am using android studio idea for my libgdx project. I configured custom desktop configuration setting
Tasks: desktop:run
Gradle Project: mygame
Running android works fine but running this configuration brings the following error
9:08:42 PM: Executing task 'desktop:run'...
Executing tasks: [desktop:run]
Configuration on demand is an incubating feature. WARNING:
Configuration 'compile' is obsolete and has been replaced with
'implementation'. It will be removed at the end of 2018 Gradle now
uses separate output directories for each JVM language, but this build
assumes a single directory for all classes from a source set. This
behaviour has been deprecated and is scheduled to be removed in Gradle
5.0 at build_4irp102idy0ifcnkhwn53osnp$_run_closure3.doCall(D:\LibgdxProjects\Tembo\desktop\build.gradle:22)
(Run with --stacktrace to get the full stack trace of this
deprecation warning.)
FAILURE: Build failed with an exception.
What went wrong: java.lang.NullPointerException (no error message)
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 9:08:45 PM: Task execution finished 'desktop:run'.
Important details
Gradle version: 4.4
How can i fix this. I tried downgrading my gradle version but the minimim supported is 4.4
NOTE: running gradlew desktop:run on project root works.

currently this version of gradle is not supported you can use version 2.3.3
There is an activity to upgrade to Gradle 4.6 which you can follow up here
https://github.com/libgdx/libgdx/issues/5177

Related

how to fix "gradlew genSources"

I'm on windows 10, when I do "gradlew genSources" then this happened
Starting a Gradle Daemon, 7 stopped Daemons could not be reused, use --status for details
> Configure project :
Fabric Loom: 0.10.66
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\user\Downloads\MCJAVA\vector-addon\build.gradle'
* What went wrong:
Could not compile build file 'C:\Users\user\Downloads\MCJAVA\vector-addon\build.gradle'.
> startup failed:
General error during conversion: Unsupported class file major version 62
java.lang.IllegalArgumentException: Unsupported class file major version 62
1 error
* 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 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.2/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 5s
I want to know how can i fix it and im not good at coding and my english is not that good, I still tried with --stacktrace it still have similir error please help me
(its have a lot more text in code but its too much and i dont think it important)

compileReleaseJavaWithJavac' task (current target 1.7) and 'compileReleaseKotlin' task (current target 1.8) jvm target compatibility should be same

I'm Using a third party library as a jar download in my project called "bandlibrary". Getting following error.
[root#ip-172-31-23-189 hsandroidconsumer]# ./gradlew assembleABCRelease
Configuration on demand is an incubating feature.
Configure project :app
Warning: The 'kotlin-android-extensions' Gradle plugin is deprecated. Please use this migration guide (https://goo.gle/kotlin-android-extensions-deprecation) to start working with View Binding (https://developer.android.com/topic/libraries/view-binding) and the 'kotlin-parcelize' plugin.
WARNING: API 'variant.getMappingFile()' is obsolete and has been replaced with 'variant.getMappingFileProvider()'.
It will be removed in version 5.0 of the Android Gradle plugin.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getMappingFile(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
Task :bandlibrary:compileReleaseKotlin FAILED
'compileReleaseJavaWithJavac' task (current target is 1.7) and 'compileReleaseKotlin' task (current target is 1.8) jvm target compatibility should be set to the same Java version.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':bandlibrary:compileReleaseKotlin'.
Kotlin could not find the required JDK tools in the Java installation. Make sure Kotlin compilation is running on a JDK, not JRE.
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 1m 29s
23 actionable tasks: 1 executed, 22 up-to-date

Error while debugging first app in flutter using a real device

I'm using VS code without Android studio in Ubuntu 20.04. While running the first app in flutter in debugging mode in an real device produced this error given below. I also tried to change my JDK version but it didn't worked.
Launching lib/main.dart on Nokia 6 1 Plus in debug mode...
FAILURE: Build failed with an exception.
* What went wrong:
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
* 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 12s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 18.3s
Exception: Gradle task assembleDebug failed with exit code 1
Please suggest a solution!
Your gradle sync has failed for some reason.
Do this
File > Open
Navigate to your project
You will see an android folder there open that as project in a new window
Check the gradle sync issues and resolve those

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.

Android Studio gradle failure on debug

Gradle:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':name: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.
Try to run "gradlew compileDebug" from the command line to fix this problems. See this answer for more information.
Also make sure to update your gradle plugin to the latest version. (0.4.3 since yesterday)
Use com.android.tools.build:gradle:0.4.+ in your gradle.build file and you'll always get the latest gradle android plugin.

Categories