How to solve this Error ::: File google-services.json is missing. The Google Services Plugin cannot function without it - flutter

enter image description hereError only while testing on phone device ,, Working fine in browser.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugGoogleServices'.
File google-services.json is missing. The Google Services Plugin cannot function without it.
Searched Location:
/Users/mb/Js/untitled/android/app/src/debug/google-services.json
/Users/mb/Js/untitled/android/app/src/google-services.json
/Users/mb/Js/untitled/android/app/src/Debug/google-services.json
/Users/mb/Js/untitled/android/app/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 8s
Exception: Gradle task assembleDebug failed with exit code 1
[![enter image description here](https://i.stack.imgur.com/1nXzY.png)](https://i.stack.imgur.com/1nXzY.png)

Switch into the android directory and first call ./gradlew clean. This gets the android project in flutter to a brand new state. Then go back to your flutter directory and call flutterfire configure. This will register your app with the firebase console and sync down all your application keys. Once this is done, you should be able to build like normal. On the first compilation of your app, it will generate a google-services.json file from the API keys within the flutter project.

Related

build apk working in flutter but run in emulator dose not work

i download flutter yesterday and make a project by flutter create command
i had problem in the build and run at first but i follow the instructions of https://docs.flutter.dev/deployment/android
then i build the app and try it in my phone and it work
but when i try to run the app in my phone by usb or in the emulator the same error happend
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:validateSigningDebug'.
java.util.concurrent.ExecutionException: com.android.builder.utils.SynchronizedFile$ActionExecutionException: java.io.IOException: com.android.ide.common.signing.KeytoolException: Failed to create keystore.
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 6s
Exception: Gradle task assembleDebug failed with exit code 1
i tried the solve of the website above

erron on vscode gradle

i have one error that's is impossible for me to solve, what kind of problem is this shit?
I've searched for many ways to fix this but i don't have found it nothing for this problem on vscode only for android studio, someone can help me?
enter image description here
this impossibilite me to deploy my application in a on virtual android always stop in this error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.ResourceCompilerRunnable
> Resource compilation failed. Check logs for details.
* 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
Exited (sigterm)
You should run
flutter run --verbose
and try to upload new image error.
I've found it whats happening man,in flutter in pub dev they gave changed the ways of splash screen it's not using the drawables anymore,we must create in lib paste the archive called Splash-Screen.dart and code all the splash screen rsrsrs but i'll appreciate your bro,and i'm very thankfull for that.

Flutter Exception: Gradle task assembleDebug failed with exit code 1. when hotspot is on

An error appears when I run my flutter app with hotspot on:
FAILURE: Build failed with an exception.
* What went wrong:
The first result from the daemon was empty. Most likely the process died immediately
after connection.
* 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
Exception: Gradle task assembleDebug failed with exit code 1
I need the hotspot because I want to run the app on physical device using pair wifi to connect to the same wireless network.
What's wrong?
I resolved my issue when I updated gradle in my flutter project by:
Create a new temp project with the latest version of Flutter.
In the temp project open android/gradle/wrapper/gradle-wrapper.properties and check the distributionUrl. Update your old project to use the same one.
For me today the distributionUrl looks like this:
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
Rerun your app. It has to download the new version of gradle to the android/.gradle directory so the first time might take a while.

unable to run flutter app on real device using vs code

for the first time using flutter on vs code, I tried running the app on my mobile without an emulator so after enabling the USB debugger and connecting the device. clicking the start debugging icon won't display the app on the screen except for an error in the console.
Launching lib\main.dart on SM G935F in debug mode... lib\main.dart:1
FAILURE: Build failed with an exception.
What went wrong: Could not open settings generic class cache for settings file
'D:\flutterproj\vstest\flutter_application_1\android\settings.gradle'
(C:\Users\abdal.gradle\caches\6.7\scripts\1fnwrr8g4rohfp291nvlxj5qe).
BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 60
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 13s Exception: Gradle task assembleDebug failed
with exit code 1 Exited (sigterm)
Just to let you know I already have the flutter SDK downloaded as well as the other things.
and the code has no error it's the same as when you open the flutter app for the first time
please tell me if you need more info.
thanks

Opening Android Emulator with an existing project

I need to reopen the Android Emulator with my existing project. When I press the button to "run" the project from the main file, I get the following error:
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
> Unable to delete directory 'C:\Users\albat\code\hello_world\build\app\generated\not_namespaced_r_class_sources\debug\r\androidx' after 10 attempts
* 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
Also, instead of the "Pixel 2 API" device, that I always use, it tried to render with "sdk gphone x86".
Thank you for the help.
from android studio find android AVD manger. it will show you a list of all your emulators.
choose one and click run.
wait for it to boot up then try running your app again.
let me know if this works for you.
Open AVD manager and choose your emulator.
If your running app shows any error. delete your unnecessary previous app.
then run again and solved your current problem.
Please checked local.properties file in your app folder. If this file is not existing then create local.properties and add your sdk link
sdk.dir=/Users/<yourUserName>/Library/Android/sdk.