running flutter app got Execution failed for task ':bluetoothadapter:compileDebugJavaWithJavac' - flutter

I didn't change anything in my Flutter application and it was running perfectly but when i tried running on real device i got this exception
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':bluetoothadapter:compileDebugJavaWithJavac'.
> Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_321 contains a valid JDK installation.
BUILD FAILED in 13s
Exception: Gradle task assembleDebug failed with exit code 1

Check out this post for a workaround:
tools.jar seems to be not in Android Studio classpath on Windows 8
It seems, the tools.jar is not present on every version of Java 8 anymore. Also make sure to use a JDK and not a pure JRE for development.
Maybe it is worth downloading a current version of the JDK from https://adoptopenjdk.net

Related

The operation couldn’t be completed. Unable to locate a Java Runtime

My android studio Running Gradle task 'assembleDebug' take so long time.. so I coudn't run emulator.
So I searched Flutter App stuck at "Running Gradle task 'assembleDebug'... ".
and I tried to gradle clean but error below.
The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.
Why it takes related Java and how can I resolve this for running emulator?..

Xcode fails on Kotlin Multiplatform due to "Execution failed for task ':core:linkReleaseFrameworkIos'"

Since core is how we named the pod to handle KMM from Xcode, what the hell is linkReleaseFrameworkIos?
Everything worked perfectly before, but now my Xcode gives me error saying
Command PhaseScriptExecution failed with a nonzero exit code
* What went wrong:
Execution failed for task ':core:linkReleaseFrameworkIos'.
I tried:
Pod reinstall
Clean project
Delete derived data
Gradlew clean(success), Gradle build(failed), Gradlew linkReleaseFrameworkIOS(failed) commands
nothing helped.
SOLVED
Bumped the ktor version to 1.6.1 and coroutines version to 1.5.0.
They did not match for some reason.

Flutter get error "Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain"

I'm trying to run my project , I am getting error
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
Exception: Gradle task assembleDebug failed with exit code 1
It is hard to know the problem with so little information. One general approach with worked to me was performing:
flutter clean
Try to run.
If it does not run delete the jar file under android/gradle/properties to recompile it and try again.

Flutter - Gradle task assembleDebug failed

When you run flutter run, such an error is displayed, when checking flutter doctor no error, what is the reason?
I was facing the same issue for my project earlier and found the solution as below.
I have changed the Gradle wrapper properties distribution URL version to: 5.5.1-all which was available in my system.
Due to some reason, the android studio was fetching the latest version which was not in my system.
Problem:
Zip error occurs while compiler tries to wrap code with Gradle wrapper properties.
If the required files are missing or not properly available after downloading, this error occurs.
Solutions:
1) Redownload the Gradle which you are using currently.
2) Change the version of Gradle wrapper property version available in your system.

How do I update android studio's gradle?

This is what I'm receiving from Android Studio, but I don't know how to fix this in the latest version.
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.internal.version-check']
> Minimum supported Gradle version is 5.6.4.
Edit: I changed the gradle-wrapper.properties to
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
And now also went to File/Settings/Build, Execution, Deployment/Gradle, and changed the Gradle User Home to a gradle-5.6.4 that I downloaded.
But now, I'm receiving this:
Finished with error: Gradle task assembleDebug failed with exit code 1