I formatted my PC and kept flutter sdk location in the same spot. The only difference was the name of the user folder. Before it was called "thesl", but now it's "bscho". Whenever I go to build my flutter application, I get this:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Failed to create parent directory 'C:\Users\thesl' when creating directory 'C:\Users\thesl\OneDrive\dev\redlino\redlino\android\app\build\intermediates\flutter\debug\flutter_assets'
* 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
Exited (sigterm)
The path of my Flutter SDK is: C:\dev\flutter
The path of my Flutter app (where the pubspec.yaml is located) is: C:\dev\redlino\redlino (yes the two redlino's are there on purpose)
It also doesn't help that my project files used to be in OneDrive which I have since uninstalled.
I fixed my problem by deleting the build folder in the android/app directory.
In android/app there is build.gradle.
Try delete it.
I'm also facing the same issue and resolve it by deleting the build folder in the android/app directory.
I'm talking about build folder not build.gradle file. So be careful while deleting.
Related
I am having issues with my flutter project. Whenever I run the flutter build apk command. I get the following error message. I tried flutter clean but it does not solve the problem. Here is my error message.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not determine the dependencies of null.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not create service of type OutputFilesRepository using ExecutionGradleServices.createOutputFilesRepository().
> Cannot lock Build Output Cleanup Cache (C:\Users\JUSTINE NALWOGA\Desktop\EDUSELF FINAL\eduself\android\.gradle\buildOutputCleanup) as it has already been locked by this process.
* 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 5m 22s
Running Gradle task 'assembleRelease'... 337.9s
Gradle task assembleRelease failed with exit code 1
Try running this command in a terminal,
find ~/.gradle -type f -name "*.lock" -delete
or
Go to /.gradle folder and manually delete all files ending with .lock.
Then run flutter clean,
flutter pub get and finally run
flutter build apk.
i have a problem when i try to build flutter apk i get this error even tho i have the right file with the right name in the right place !
i tried deleting the pub cash folder from flutter folder but still the same
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':cloud_firestore:processReleaseGoogleServices'.
File google-services.json is missing. The Google Services Plugin cannot function without it.
Searched Location:
AppData\Local\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-3.1.18\android\src\release\google-services.json
AppData\Local\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-3.1.18\android\src\google-services.json
AppData\Local\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-3.1.18\android\google-services.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 1m 7s
Running Gradle task 'assembleRelease'... 68.6s
Gradle task assembleRelease failed with exit code 1
Process finished with exit code 1
flutter clean
flutter pub get
It helped me in my case
Happened to me before and the reason was that there was a space in the file name
"google-services .json"
So double-check if the file name is exactly like this "google-services.json"
and the path for the file is APP_NAME\android\app\google-services.json
If everything is correct run flutter clean then flutter pub get
In my case, it was similar to your 'BUILD FAILURE'
Compiler tried to find 'google-services.json' in '\flutter\.pub-cache'
So I solved it by clearing the cache folder. (see below)
Solution
Step 1
Clear the cache
Clear the global PUB_CACHE:
flutter pub cache clean
or
Go to that path and directly delete the cache.
Step 2
Get packages and run
flutter pub get
and
flutter run
I hope my answer is helpful.
I have created app icons with a website called appicon. It provided icon files for both android(mipmap files) and ios devices(an Assets.xcassets file), which I added to their respective locations being (C:\Users\user\StudioProjects\i_am_rich(name of app)\android\app\src\main\res) for android and (C:\Users\user\StudioProjects\i_am_rich\ios\Runner) for ios.
When I run the program the following error is displayed:
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\user\StudioProjects\i_am_rich\build\app\intermediates\packaged_manifests\debug\AndroidManifest.xml:16: AAPT: error: resource mipmap/ic_launcher (aka com.example.i_am_rich:mipmap/ic_launcher) not found.
* 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 36s
Exception: Gradle task assembleDebug failed with exit code 1
I am learning Android Studio as the IDE with flutter, as a beginner, so I don't understand the problem nor what I have to do to fix it.
Help and, possibly, an explanation would be greatly appreciated :)
The website you mentioned does generate correct names and correct order of directories it seems. so most probably this is an issue with where you have put your files or the name of the files.
The 5 directories of icons must be copied to android\app\src\main\res folder.
and make sure in each directory you have a file called ic_launcher
if all is correct, please run flutter clean command and try again.
also by anychance the webisite generating incorrect files, try using this web site AndroidAssetStudio
I have implemented various methods but errors appear every time I run android.
If you delete the path_provier_macos folder, a linux error appears.
You are currently using path_provier: ^1.6.11. Lowering the path_provier version is the same.
Please tell me the solution.
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 determine the dependencies of task ':path_provider:compileDebugAidl'.
> Could not resolve all task dependencies for configuration
':path_provider:debugCompileClasspath'.
> Could not resolve project :path_provider_macos.
Required by:
project :path_provider
> Unable to find a matching configuration of project :path_provider_macos:
- None of the consumable configurations have attributes.
> Could not resolve project :path_provider_linux.
Required by:
project :path_provider
> Unable to find a matching configuration of project :path_provider_linux:
- None of the consumable configurations have attributes.
* 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
Finished with error: Gradle task assembleDebug failed with exit code 1
Go to your Flutter sdk folder.
Go to [.pub-cache\hosted\pub.dartlang.org\ or .pub-cache\hosted\pub.flutter-io.cn\ ]
Remove all path_provider folders.
Pub get
Run your app.
I hope this fix your problem!
Welcome all
I'm developing an automatic APK generator which compiles android apps using gradle console commands. I found this problem:
FAILURE: Build failed with an exception.
* What went wrong:
Failed to create parent directory '/root/.gradle/caches/2.2.1/scripts/settings_14c7jxprvkvxiv2ted70j3e0u' when creating directory '/root/.gradle/caches/2.2.1/scripts/settings_14c7jxprvkvxiv2ted70j3e0u/SettingsScript/buildscript'
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
java.lang.Exception: Error processing Build command. Error code: 1
The problem is that directory /root/.gradle/caches/2.2.1/scripts/has hundreds of thousans of subdirectories generated and it has reached linux inode limit.
Why is gradle generating all those directories and how can i tell gradle to stop this? Whould be perfect if gradle has an option to delete/clean these cache directories automatically.
IMPORTANT: I'm not using android studio, all the process is automatized and using console commands (gradle assembleRelease)
Thx