Flutter build failed in ubuntu 19.10 - android

I have a flutter apps which is building perfectly in another machine(ubuntu 18.04). Now I am using ubuntu 19.10 , when I tried to run this apps using flutter run command, its throws these errors:
Launching lib/main.dart on Primo EF6 in debug mode...
FAILURE: Build failed with an exception.
* What went wrong:
Cannot create service of type PayloadSerializer using ToolingBuildSessionScopeServices.createPayloadSerializer() as there is a problem with parameter #2 of type PayloadClassLoaderFactory.
> Cannot create service of type PayloadClassLoaderFactory using ToolingBuildSessionScopeServices.createClassLoaderFactory() as there is a problem with parameter #1 of type CachedClasspathTransformer.
* 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
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 5.5s
Gradle task assembleDebug failed with exit code 1
I think it is gradle issue. I am using flutter v1.12.13+hotfix.6

Fixed this problem. There was a permission issue on .gradle directory, it was readonly . So changing permission solves this issue.

Related

I using Macbook Air mid 2013 for flutter without Xcode . Why I can't run in android emulator

Launching lib/main.dart on Android SDK built for x86 in debug mode...
lib/main.dart:1
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':app:processDebugResources' (type 'LinkApplicationAndroidResourcesTask').
- In plugin 'com.android.internal.version-check' type 'com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask' property 'androidJarInput.androidJar' specifies file '/Users/macbook/Library/Android/sdk/platforms/android-31/android.jar' which doesn't exist.
Reason: An input file was expected to be present but it doesn't exist.
Possible solutions:
1. Make sure the file exists before the task is called.
2. Make sure that the task which produces the file is declared as an input.
Please refer to https://docs.gradle.org/7.4/userguide/validation_problems.html#input_file_does_not_exist for more details about this problem.
* 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 36s
Exception: Gradle task assembleDebug failed with exit code 1
Exited

Flutter Error. Execution failed for task ':app:processDebugMainManifest'

Hey I want to start learning flutter and I bought a course but when I try to run the auto-generated app I get the following error:
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> com.android.manifmerger.ManifestMerger2$MergeFailureException: java.io.FileNotFoundException: E:\Flutter\untitled\build\app\intermediates\navigation_json\debug\navigation.json (The system cannot find the file specified)
* 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 31s
Running Gradle task 'assembleDebug'...
[!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> com.android.manifmerger.ManifestMerger2$MergeFailureException: java.io.FileNotFoundException: E:\Flutter\untitled\build\app\intermediates\navigation_json\debug\navigation.json (The system cannot find the file specified)
* 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
[!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
Exception: Gradle task assembleDebug failed with exit code 1
I saw other people talk about this here but the solution that worked for them didn't work for me.
Here are the things I've tried:
./gralew clean or./gradlew build
/flutter clean
reinstalling flutter and android studio from scratch.
deleting the gradle files and the build files.
switching to another laptop.
I will be very grateful if you guys can help me.
Best Regards,
-Roee Hovav.
Peace!
Open Android Studio make sure you have the latest version installed, and everything is updated then go ahead and open the Flutter project and trying building it from Android Studio
I found the similar error but for me is missing of androidmanifest.xml and I have fixed it
For me I have deleted the android folder and run command "flutter create ."
then I got another of errors about "SdkMinVersion" and "Flutter multidex handling is disabled." and fixed it step by step
Anyway I have found this solution after I have fixed and hope it will help you
--> changing gradle version as the link below
https://github.com/tekartik/sqflite/issues/380

What does the error "Could not configure services using GradleScopeCompileServices.configure()." mean and how can I fix it?

I am new to flutter and watned to create my first app.
I installed Flutter. I tested it using flutter doctor and got no errors. I created a new app using flutter create my_app. In the app directory I ran flutter build apk and got the following error back.
C:\Users\Username\StudioProjects\my_app3> flutter build apk
Building with sound null safety
FAILURE: Build failed with an exception.
* What went wrong:
Could not create an instance of type org.gradle.invocation.DefaultGradle.
> Could not configure services using GradleScopeCompileServices.configure().
* 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
Running Gradle task 'assembleRelease'... 2.560ms
Gradle task assembleRelease failed with exit code 1

How to resolve Gradle task assembleDebug failed with exit code 1 in my first flutter app?

I recently come from java and try to make my first app in flutter in android studio in windows 10.
I tried first sample code in my real android device and got this error.
I cant find proper after struggling 5 hours
In console get this error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:stripDebugDebugSymbols'.
> NDK at C:\Users\10\AppData\Local\Android\sdk\ndk-bundle did not have a source.properties file
* 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
Looks like you are missing NDK installation. Please confirm if highlighted item is installed

Flutter Error : Build failed with an exception

At first when I installed and ran the Android Studio the app ran perfectly, then after two days for some reason this is happening. Please help me fix this. Thanks
Launching lib\main.dart on GM1910 in debug mode...
Running Gradle task 'assembleDebug'...
Not resetting hidden file - C:\Users\zahin\AndroidStudioProjects\project1\build\app\intermediates\flutter\debug\flutter_assets\assets\ss\Thumbs.db
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:signingConfigWriterDebug'.
> java.nio.file.AccessDeniedException: C:\Users\zahin\AndroidStudioProjects\project1\build\app\intermediates\signing_config\debug\out\signing-config.json
* 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
Exception: Gradle task assembleDebug failed with exit code 1
Use flutter clean or remove the build folder on your project root then try again.

Categories

Resources