How can I address the error of "flutter pub get" - android

After typing
"flutter clean" -> "flutter pub cache repair" -> "flutter pub get"
android studio give me below message
I don't know how to resolve, please someone help me.
I reinstalled all the suite that flutter needs so many times, but it still did not work, I have already drained my brain.
my pubspec.yaml like this

Related

I am learning flutter and the project is giving 'Gradle task assembleDebug failed with exit code 1'

I am learning flutter and the project is giving 'Gradle task assembleDebug failed with exit code 1'
It is just giving the error just in emulator and working fine in windows and browser. and this is the error I am getting while debugging in vs code
Can anyone please help me with this
I searched everywhere but didn't find anything to solve this issue
First of all run:
C:\src\flutter>flutter doctor
And make sure that there are no errors.
Secondly, make:
C:\src\flutter>flutter create myproj
And follow the instructions.
The correct output should be:
C:\Users\hp\Projects\test>flutter create myproj
Creating project myproj...
Running "flutter pub get" in myproj... 2.859ms
Wrote 127 files.
All done!
In order to run your application, type:
$ cd myproj
$ flutter run
Your application code is in myproj\lib\main.dart.

easy_localization code generation process is not getting through from Android Studio Terminal

After setting up all the .json files, pubspec file and initialization in the main method when I am trying to create the codegen_loader.g.dart file from the terminal by invoking flutter pub run easy_localization:generate, it's not getting through. Even no error message is getting.
Below is a snippet of the command line:
PS C:\Users\Prosanto\Desktop\Android Dev\localization> flutter pub run easy_localization:generate -h
PS C:\Users\Prosanto\Desktop\Android Dev\localization> flutter pub run easy_localization:generate -S "assets/translations" -O "lib/translations"
PS C:\Users\Prosanto\Desktop\Android Dev\localization>
Nothing is happening, any help or suggestion is highly helpful.
I dealt with this same issue on Mac, but these steps should still help.
First, I ran this command from the Mac terminal, not from Android Studio (whether that made any difference, who knows, but it wasn't working when running from the IDE). It's different from the easy_localization docs
flutter pub run easy_localization:generate --source-dir assets/translations
After that, I ran this command:
flutter pub run easy_localization:generate -S assets/translations -f keys -o locale_keys.g.dart
And the necessary files were generated as expected. I hope this helps!

Android sdkmanager not found

I want to use flutter but I am getting this while running flutter doctorError
I have cmdline tools install as seen in below picture
android sdk tools
But when I use command "flutter doctor --android-licenses"
It is showing sdkmanager not found:-Sdkmanagernot found error
I have tried literally everything mentioned on internet to remove this error but nothing works
// try to set
flutter config --android-sdk <path-to-your-android-sdk>

firebase_auth can't install new version

I'm trying to install firebase_auth in my flutter project. To install flutter pub add firebase_auth I am using command. It installs firebase_auth package but installs version ^0.15.4. It does not install the new version and naturally causes conflicts.
I'm getting an output like this:
[simto_todolist] flutter pub get
Running "flutter pub get" in simto_todolist... 1.084ms
exit code 0
--
[simto_todolist] flutter pub get
Running "flutter pub get" in simto_todolist...
Cannot create link, path = 'C:\src\flutter\.pub-cache\_temp\dir20230c53\ios\Classes\FLTFirebaseAuthPlugin.m' (Operating System Error: Not granted by required privileges.
, errno = 1314)
pub get failed (66; , errno = 1314))
exit code 66
What is the problem? How can I solve it? Thank you very much in advance for the help.
You can set in manual by editing your pubspec.yaml project file
firebase_auth:
when you remove version from your file pub will install latest version

problem with running flutter app in vscode

when I run my app I get this error :
Error: ADB exited with exit code 1
Performing Streamed Install
adb: failed to install F:\flutter-project\1\third_app\third_app\build\app\outputs\apk\app.apk: Failure [INSTALL_FAILED_INVALID_APK: Package couldn't be installed in /data/app/com.example.third_app-1: Package /data/app/com.example.third_app-1/base.apk code is missing]
Error launching application on Android SDK built for x86.
update:
I run flutter clear in the terminal and after restarting my computer and executing again, the problem solved
One of the SO post mentioned in the comment:
For Flutter projects, with VS Code editor, go to the project source
folder and delete the "build" folder and start debugging.
This could also be attained by running flutter clean from the terminal. This command helps you delete build cache which is in the /build folder. You can always uses this command when there are any bugs in the build process.

Categories

Resources