location_geocoder Bad state: No element - flutter

if i want to make use from geocoder it given me this error message: Bad state: No element.
what i now is that i have giving geocoder a correctly written city name and also that i have given geocoder a api key from a payed google maps platform account.
flutter run:
Launching lib/main.dart on iPhone 13 in debug mode...
Running pod install... 14.3s
Running Xcode build...
└─Compiling, linking and signing... 13.8s
Xcode build done. 633.2s
Syncing files to device iPhone 13... 186ms
Flutter run key commands.
r Hot reload. πŸ”₯πŸ”₯πŸ”₯
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).
πŸ’ͺ Running with sound null safety πŸ’ͺ
An Observatory debugger and profiler on iPhone 13 is available at: http://127.0.0.1:50040/6fcE371o6S0=/
The Flutter DevTools debugger and profiler on iPhone 13 is available at: http://127.0.0.1:9100?uri=http://127.0.0.1:50040/6fcE371o6S0=/
flutter: null
flutter: stadt_view: bansko
flutter: Bad state: No element
flutter: null
i now that ther don't stand anything from location_geocoder but if i comment the geocoder part out: i don't have the bug anymore.
flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[βœ“] Flutter (Channel stable, 2.10.0, on macOS 12.1 21C52 darwin-x64, locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
βœ— cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
βœ— Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[βœ“] Xcode - develop for iOS and macOS (Xcode 13.2.1)
[βœ“] Chrome - develop for the web
[βœ“] Android Studio (version 2021.1)
[βœ“] IntelliJ IDEA Community Edition (version 2020.3.3)
[βœ“] VS Code (version 1.64.0)
[βœ“] Connected device (2 available)
[βœ“] HTTP Host Availability
! Doctor found issues in 1 category.
Please help me

just use http package instead location_geocoder that worked for me

Related

Android Studio and VS Code stuck on "Syncing files to device" when trying to debug flutter app on iOS simulator with M1 mac

I am working on a flutter app with my M1 MacBook Pro and can't get the debugger of Android Studio or VS Code to work with an iOS simulator (iPhone 14 Pro with iOS 16.2). When I try to start debugging in Android Studio I get this output in the console:
Launching lib/main.dart on iPhone 14 Pro in debug mode...
Running Xcode build...
Xcode build done. 9,5s
Debug service listening on ws://127.0.0.1:62652/S84BCtJtulI=/ws
Syncing files to device iPhone 14 Pro...
After that nothing happens.
I tried running the simulator via Rosetta, but that did not help.
It is running fine with flutter run and from Xcode itself but I want the debugger in Android Studio (or VS Code).
This is the result for flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[βœ“] Flutter (Channel master, 3.7.0-13.0.pre.41, on macOS 13.0.1 22A400 darwin-arm64, locale de-DE)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
βœ— cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
βœ— Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[βœ“] Xcode - develop for iOS and macOS (Xcode 14.2)
[βœ“] Chrome - develop for the web
[βœ“] Android Studio (version 2021.3)
[βœ“] VS Code (version 1.74.3)
[βœ“] Connected device (3 available)
[βœ“] HTTP Host Availability
! Doctor found issues in 1 category.
Am I doing something wrong? Am I missing something?

i can't debug on physical device

i am trying to debug on a physical device a flutter app. During launch it freezes on:
Running Gradle task 'assembleDebug'...
i run the program with
flutter run -v
, everything works perfectly.
this is my flutter doctor
Doctor summary (to see all details, run flutter doctor -v): [βœ“]
Flutter (Channel stable, 3.3.7, on macOS 13.0.1 22A400 darwin-arm,
locale it-IT) [βœ“] Android toolchain - develop for Android devices
(Android SDK version 33.0.0-rc1) [βœ“] Xcode - develop for iOS and macOS
(Xcode 14.1) [βœ“] Chrome - develop for the web [βœ“] Android Studio
(version 2021.3) [βœ“] VS Code (version 1.73.1) [βœ“] Connected device (4
available) [βœ“] HTTP Host Availability
β€’ No issues found!
during startup I get a white screen on the physical device, but I don't get errors of any kind.
help please?
it happened to me many times,
when that happened I use flutter clean and then close and reopen
vs code and most important I delete my old versions of the app this soluation works fine for me and I hope that helps you

Flutter launcher icons fails because --sound-null-safety missing

I am trying to create icons for my app using flutter_launcher_icons, with options defined in pubspec.yaml. When I run flutter pub run flutter_launcher_icons:main, I get the following error:
Unable to spawn isolate: error: Library 'file:///Users/cameron/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_launcher_icons-0.9.0/bin/main.dart' was compiled with sound null safety (in strong mode) and it requires --sound-null-safety option at runtime
pub finished with exit code 1
Even if I pass in --sound-null-safety, the error persists (I also tried '--no-sound-null-safety' which also did nothing).
To check it wasn't a configuration error, I ran flutter create <name>, added flutter_launcher_icons: to dev dependencies (and flutter pub get), ran the same command and got the same error.
I am on Flutter 2.2, and I depend on integration_test, so I can't downgrade to a pre-null-safety version of flutter_launcher_icons, because those versions have transitive dependencies that conflict with integration_test from sdk.
Flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[βœ“] Flutter (Channel stable, 2.2.2, on macOS 11.4 20F71 darwin-x64, locale en-GB)
[βœ“] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[βœ“] Xcode - develop for iOS and macOS
[βœ“] Chrome - develop for the web
[βœ“] Android Studio (version 4.1)
[βœ“] IntelliJ IDEA Ultimate Edition (version 2020.3.4)
[βœ“] VS Code (version 1.57.1)
[βœ“] Connected device (2 available)
β€’ No issues found!

Exception: Profile mode is not supported for iPhone 11 Pro when profile flutter app

When I run app in profile mode in Android Studio 4.1.2:
show this error:
Exception: Profile mode is not supported for iPhone 11 Pro.
why would this happen and what should I do to fix it? This is my env:
~/source/dabai/microservice/soa-illidan-hub on ξ‚  feature/cardrobot ⌚ 22:29:08
$ ~/apps/flutter/bin/flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[βœ“] Flutter (Channel stable, 1.22.6, on Mac OS X 10.15.7 19H114 darwin-x64, locale en-CN)
[βœ“] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[βœ“] Xcode - develop for iOS and macOS (Xcode 12.4)
[!] Android Studio (version 4.1)
βœ— Flutter plugin not installed; this adds Flutter specific functionality.
βœ— Dart plugin not installed; this adds Dart specific functionality.
[!] IntelliJ IDEA Community Edition (version 2020.3.2)
βœ— Flutter plugin not installed; this adds Flutter specific functionality.
βœ— Dart plugin not installed; this adds Dart specific functionality.
[!] IntelliJ IDEA Ultimate Edition (version 2019.2.2)
βœ— Flutter plugin not installed; this adds Flutter specific functionality.
βœ— Dart plugin not installed; this adds Dart specific functionality.
[βœ“] VS Code (version 1.53.2)
[βœ“] Connected device (1 available)
! Error: xiaoqiang ηš„ iPhone is not connected. Xcode will continue when xiaoqiang ηš„ iPhone is connected. (code -13)
! Doctor found issues in 3 categories.
using command also failed:
~/Documents/GitHub/cruise-open on ξ‚  feature/channel ⌚ 22:42:08
$ ~/apps/flutter/bin/flutter run --profile
Profile mode is not supported by sdk gphone x86 arm.
If this issue occurs both on Simulator and physical device, it's possible that timeouts in the Observatory port as mentioned on this thread. Try upgrading the Flutter version that you're using and see if it solves the issue. If it persists, run flutter run --profile --verbose to see more details on what's causing the issue.

Error connecting to the service protocol: Exception: Attempted to connect to Dart observatory 5 times, and all attempts failed. Giving up. The URL was

My app starts but then stops because of the error. I am using Windows 10, android studio as an IDE, and trying to build an android app.
if I use a terminal outside of Android studio it works, so it should be android studio related.
console:
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
Gradle task 'assembleDebug'...
Built build\app\outputs\apk\debug\app-debug.apk.
Installing build\app\outputs\apk\app.apk...
Error connecting to the service protocol: Exception: Attempted to connect to
Dart observatory 5 times, and all attempts failed. Giving up. The URL was
ws://127.0.0.1:50997/ws
flutter Doctor:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.0.0, on Microsoft Windows [Version
10.0.16299.847], locale de-DE)
[!] Android toolchain - develop for Android devices (Android SDK 28.0.3)
X Android license status unknown.
[√] Android Studio (version 3.2)
[√] Connected device (1 available)
! Doctor found issues in 1 category.
If you have configured a proxy,
ensure you have also set the environment variable
NO_PROXY=127.0.0.1