problem in building apk file in android studio with flutter - android

I use android studio and flutter. two days ago I updated them and after that, I cannot build apk files, even the demo program that is increment counting with floating action button. I do not know how to fix it. Here is the error:
C:\src\flutter\bin\flutter.bat --no-color build apk
Building with sound null safety
Running Gradle task 'assembleRelease'...
FAILURE: Build failed with an exception.
What went wrong:
org/fusesource/jansi/Ansi
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
Running Gradle task 'assembleRelease'... 1,695ms
Gradle task assembleRelease failed with exit code 1
Process finished with exit code 1
I even uninstalled android studio and reinstalled it but it did not work. Can anybody help me with this problem?

Related

fastutil 7.2.0 .jar cannot be created

I have installed android studio properly, gave it all it needed for flutter development, java jdk version is 11, paths are properly given, the emulator runs fine but when i try to build my app on either emulator or a physical device, I get this error:
Launching lib\main.dart on V2109 in debug mode...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
Where:
Build file 'D:\untitled1\android\app\build.gradle' line: 26
What went wrong:
A problem occurred evaluating project ':app'.
java.util.concurrent.ExecutionException: org.gradle.api.GradleException: Failed to create Jar file C:\Users\ADMIN.gradle\caches\jars-9\53ad1f30a5eec66e4e9dc584d5b89b7f\fastutil-7.2.0.jar.
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
Exception: Gradle task assembleDebug failed with exit code 1
Here is my flutter doctor response
Please help. Your help will be appreciated
I was expecting the project to run properly, as with the same flutter doctor response and same installation procedures on 2 different laptops I was able to run properly. I have tried reinstalling android studio thrice but of no help. tried everything I could related to java (installed different versions, updating paths).

Unable to create bundle in flutter

I am building a flutter project using Gradle. When I ran
flutter build appbundle
I got the error as shown below
FAILURE: Build failed with an exception.
* What went wrong: Execution failed for task ':image_gallery_saver:compileReleaseKotlin'.
> Kotlin could not find the required JDK tools in the Java installation '/Library/Internet
Plug-Ins/JavaAppletPlugin.plugin/Contents/Home' used by Gradle. Make
sure Gradle 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 24s
Running Gradle task 'bundleRelease'...
Running Gradle task 'bundleRelease'... Done
25.7s Gradle task bundleRelease failed with exit code 1
Please help me regarding this issue.
Thanks in advance!
Make sure Gradle is running on a JDK, not JRE
You are running gradle on a JRE instead of a JDK, install JDK 16 or below (17 is not supported yet), append its bin directory to the PATH variable and remove the one of the JRE.

why does my flutter app not work after repeated reinstallations of java and gradle?

I have a problem with my Flutter app.
When I tried to start my app via an emulator, I got the following error message:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
Kotlin could not find the required JDK tools in the Java installation 'C:\Program Files\AdoptOpenJDK\jre-11.0.11.9-hotspot' used by Gradle. Make sure Gradle 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 1s
Exception: Gradle task assembleDebug failed with exit code 1
.
this is the standrad app which is created by flutter when creating a project and I have not changed it. When I received the message for the first time, I reinstalled gradle and java. but it didn't work. Can you help me?

Run a Flutter Project with Android Studio is not possible anymore

I startet my Flutter project via Android Studio for a while and i had no problem to code and to run this project from e AVD oder a physiical Device (via USB). One week ago, i had a problem because of JAVA_HOME. I could solved this problem but its still not possible to run this problem. Bow i have this message when i try to run my project:
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
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 1s
Finished with error: Gradle task assembleDebug failed with exit code 1
What can i do?
1- project fence
2- select Android / gradle / wrapper / gradle-wrapper.properties
3- change the distributionUrl line
to https \: //services.gradle.org/distributions/gradle-6.3-all.zip
That solves your problem?
Reference image
They asked the same thing here
https://stackoverflow.com/questions/35000729/android-studio-could-not-initialize-class-org-codehaus-groovy-runtime-invokerhel

ERROR When Running Flutter App in Android Studio: Execution failed for task ':app:generateDebugBuildConfig'

Im new to mobile app development but I wanted to build a very simple app. I was searching online and found Flutter to be the most appealing option. I found some videos showing you how to set up Flutter with Android Studio. I followed the video and everything was going great until I ran into a problem when trying to run the Flutter template on an emulator. I got this error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:generateDebugBuildConfig'.
> java.nio.file.AccessDeniedException: C:\Users\ivomu\Desktop\New folder\PROGRAMIRANJE\Flutter Apps\WeightAppp\build\app\generated\source\buildConfig\debug\com\example\WeightAppp
* 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
Exception: Gradle task assembleDebug failed with exit code 1
I looked online and found no one else with such proble. How do I fix this?
java.nio.file.AccessDeniedException
Flutter probably doesn't have permission to access the specific file(s).
If you are using the command prompt, try running it with admin privileges. If you are using Android Studio, try opening Android Studio as an admin.

Categories

Resources