flutter has a problem with redux dependencies - flutter

i have a problem to run my flutter app, it seems flutter doesn't recognize it. i tried to connect to internet while running the project but the problem remains the same, here is the error message:
and here is the code where i inserted the dependency :
dependencies:
redux: ^4.0.0
flutter_redux: ^0.6.0

Your package name is likely also redux according to this Github issue. You'll have to change your package name to something other than redux and you should be able to flutter pub get.

this error was caused by the fact that i named my app REDUX, i changed it and it works now.

Related

Why is flutter not detecting locally made packages?

I have been assisting with building an app with Flutter.
My senior shared the repo with me, however when I cloned it, all of the import packages had a 'uri not found' error.
I ran flutter pub get, and all of the external packages work. However the locally made packages, such as 'package:projectname/utils/utils.dart' still have an error.
How can I fix this? Preferably the fix is in my enviroment. I do not want to change any of the code since it works for him. TIA.
pubspec.yaml
dependencies:
flutter:
sdk: flutter
stackoverflow_pkg:
path: C:\Users\xxxxx\flutter_projects\stackoverflow\stackoverflow_pkg
code:
import 'package:stackoverflow_pkg/stackoverflow_pkg.dart';

Can anyone can tell how to solve this issue as i have tried all existing solutions

I have tried all solutions on the internet and everywhere but nothing works so if someone can help me to solve this issue and this issue occurs when i try to make build for my Flutter App project
this is my yaml file
It looks like you might be using an old version of the plugin_platform_interface package.
you should have a line like this in your pubspec.yaml file:
dependencies:
plugin_platform_interface: ^2.0.1
note that according to the instructions on pub.dev this package only supports null safety in version 2.0 and above. see more at
plugin_platform_interface version log
flutter run --no-sound-null-safety
Check this:
Cannot run with sound null safety because dependencies don't support null safety

Flutter Riverpod: pub get failed

I'm currently trying to study using flutter riverpod but i get a problem when i'm trying to put flutter_riverpod package i get this error
Because riverpod depends on flutter_riverpod ^0.9.1 which depends on riverpod ^0.8.0, riverpod ^0.8.0 is required.
So, because riverpod is 1.0.0+1, version solving failed.
Running "flutter pub get" in riverpod...
pub get failed (1; So, because riverpod is 1.0.0+1, version solving failed.)
What can i do to fix this problem? I tried to add riverpod package but it's also not working
I think you should open your pubspec.yaml
at first line. probably your name is riverpod
My issue as well like you. name was flutter_riverpod
Check if your project name is riverpod
For me, that was the issue...
Just use a different name for your project.
See this decision tree created by the developer of riverpod for which version to install.
You only want to install one riverpod dependency.
In short, if you are using flutter_hooks (which I would personally recommend), install hooks_riverpod. If you are not using hooks, install flutter_riverpod.
If you are writing pure dart code (no Flutter), then install riverpod.
To reiterate, your pubspec.yaml should only ever include one riverpod dependency.
If you still have version solving issues with your dependencies after this then try deleting your pubspec.lock and reinstall your dependencies.

How to resolve Firebase AdMob Integration problem

I am trying to add AdMob ads to my Flutter app. For that, I tried using firebase_admob (^0.9.3+2) plugin but it's not working for me, it stuck at build.apk.
I am getting the output as :
Note: /home/abhishek/dev/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.9.3+2/android/src/main/java/io/flutter/plugins/firebaseadmob/AdRequestBuilderFactory.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
My dependency in pubspec.yml are :
dependencies:
flutter:
sdk: flutter
meta: ^1.1.8
platform: ^2.2.1
firebase_core: ^0.4.0+9
firebase_analytics: ^5.0.2
firebase_admob: ^0.9.3+2
Where am I doing wrong?
See if you can remove firebase_core: ^0.4.0+9 then exec flutter clean
Not sure if it is related or not, but I'm having problems adding dependencies:
Error: Could not resolve the package 'google_sign_in' in 'package:google_sign_in/google_sign_in.dart'.
lib/authsvc.dart:7:8: Error: Not found: 'package:google_sign_in/google_sign_in.dart'
import 'package:google_sign_in/google_sign_in.dart';
I'm able to add the dependency in the pubspec.yaml file, run 'pub get' and it says that it downloads fine. No errors are reported in the editor (i.e. it recognizes the new commands and doesn't flag them). However, when I try to compile/build it, I get the above error message. 'Pub get' worked fine until I upgraded to the latest version of Flutter (v. 1.17.3) before I believe I was on (v. 1.17.0).
To fix it, I hardcoded the path in the Dart_Packages.xml file.
(I'm not looking to troubleshoot further, just adding this in case it helps the developers identify the problem). Thanks!

Flutter autocomplete not working in VSCode for packages

I moved my whole flutter project to a new folder, everything runs fine. The autocomplete works on the build in files from flutter, like Container, Column, but when I try using a package, like provider, I need to go on the pub.dev page and copy the import, import it manually, then I have to write "Provider.of(context)" manually. In the old project, I used to write Provider, press TAB, and everything would be auto imported and the VSCode would auto complete everything related to provider, not just bult in files. Whan should I do?
You must make sure that your dependencies for plugins are mentioned under dependencies: section, not under dev_dependencies: section like following:
dependencies:
flutter:
sdk: flutter
cloud_firestore: ^0.13.7
firebase_auth: ^0.16.1
fluttertoast: ^7.0.2
I was getting the same issue and fixed it by changing the flutter channel.
The problem seems to be with the dart that ships with the flutter code.
If you are still facing this issue. Then try to change your channel
flutter channel ...
And then try
flutter upgrade
This will pull the dart version again and hopefully fix the import issue.
Try to restart VS Code, worked for me.