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

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

Related

Flutter Basics: Error: Type 'AssetBundle' not found. AssetBundle' isn't a type

After I added the flutter_svg: ^0.23.0+1 in pubsec.yaml getting these error.
Please check your Flutter version.
At flutter_svg github issue page, there is a same issue and solution comment.
https://github.com/dnfield/flutter_svg/issues/610
If you are on stable channel, make sure Flutter version is at least 2.5.0. You need at least 2.4.0 pre for the latest version of this package
If you do not want to upgrade your flutter, then this is also a viable solution,
use flutter_svg: ^0.22.0
https://github.com/dnfield/flutter_svg/issues/610#issuecomment-974614148
I'm on 2.2 and it is working very well.

How to set dependencies in the right way in pubspec.yaml in Flutter

Here are a few dependency examples from my pubspec.yaml file in my Flutter project.
dependencies:
flutter:
sdk: flutter
cloud_firestore: ^0.14.4
firebase_core_web: ^0.2.1
firebase_crashlytics: "^0.2.4"
firebase_analytics: "^6.3.0"
I just followed installation guidelines when installing each of them. As seen, some dependencies have the version number in "..." while others don't.
It seems to be working in both ways but I wonder what the right way of doing it. Should I always put the version number into "..." ?
The best way to do this is:
flutter pub add form_field_validator
where "form_field_validator" is the name of dependency
Have a look why it is a best method:
It automatically adjusts all of the the dependencies
So you don't get "version solving failed" error like this showing below:
Because flutter_bloc: 0.21.0 depends on provider: ^3.0.0 and no versions of flutter_bloc match: >0.21.0 <0.22.0, flutter_bloc: ^0.21.0 requires provider: ^3.0.0. So, because it tells_me that it depends on both provider: ^4.1.2 and flutter_bloc: ^0.21.0, version solving failed.
https://pub.dev/packages/form_field_validator/install
has both methods copy and paste the given command in your project directory
See below image:
Thank you I hope it clears everything, happy coding!
You can provide version numbers with and without quotes. The quotes are used for providing range constraints on dependencies like this:
dependencies:
url_launcher: '>=5.4.0 <6.0.0'
So that's why both options work. If you are not using ranges you can omit the quotes but it comes down to personal/team preference. See the Flutter documentation for more information on using packages.
If you don't put any number or version number, it takes the latest version.
When creating new projects, it will work good. However if you are re-using codes from other projects, you might want to use the exact same version of the dependencies, hence you define them.

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 has a problem with redux dependencies

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.

Because every version of flutter_test from sdk depends on... flutter_test from sdk is forbidden, version solving failed

I'm having this issue when I've added http dependency in my flutter project. Can anyone please help me with it?
If you get the message:
Because every version of flutter_test from sdk depends on...
It means flutter_test depends on a dependency with version lower than you specified in another dependency.
To solve this, open pubspec.yaml, and remove the version number of the problem dependency:
Example:
Change
archive: ^2.0.13 --> remove this number
To:
archive:
You have provided or trying to use http: ^0.12.0 dependency on implementing API calls in pubspec.yaml file but flutter_test will require http: ^0.11.3+17. That's why it fails. Please replace
dependencies:
flutter:
sdk: flutter
http: ^0.12.0
with
dependencies:
flutter:
sdk: flutter
http: ^0.11.3
Hope it will help you out.
In my case, I somehow deleted sdk: flutter:
dependencies:
flutter:
sdk: flutter
I was facing a similar error. I solved it by removing all the version numbers from the dependencies: section in pubspec.yaml.
So, if my pubspec.yaml looked like this before:
dependencies:
freezed_annotation: ^0.14.3
I changed it to this:
dependencies:
freezed_annotation:
I'm assuming this fetches the latest "possible" version of each package.
Can you please provide the dependencies in your pubspec.yaml? It looks like your app depends on at least http 0.12.0 but flutter_test specifically requires http 0.11.3+17 (an older version) which makes it fail.
If your app doesn't have too many dependencies that could broke, you can try to upgrade your Flutter version: flutter upgrade.
It most probably will fix this problem. But always be sure to understand that your app might break at unexpected places.
So you're fine if:
either you're doing it for small app
or it's big app at work and it has extensive tests that will tell you something has broken
if big app without tests, be sure to test every important place of the app, where dependencies are being used
Try to change the dependency version that you were added in your pubspec.yaml file
don't use the current or latest version try some previous versions of dependency.
for ex - if you are using latest sqflite version then chnage to previous version of that and then re-run your whole project.
In my case IDE referred to an an older version of dart because of fvm. Seems like 'run' button called fvm flutter run, but not flutter run as I expected. After I deleted fvm folder from the project the problem has gone.
Change depending attributes version inside pubspec.yaml
if it says depands on http *** than change http version
or if it says depands on collection *** than change collection version.