Can't sync android emulator with flutter project - flutter

Could Not Find C:\Users\Mohammed\AppData\Local\Android\sdk\platform-tools\AdbWinApi.dll.dat
The directory name is invalid.
W/FlutterActivityAndFragmentDelegate( 9139): A splash screen was provided to Flutter, but this is deprecated. See flutter.dev/go/android-splash-migration for migration steps.
Error waiting for a debug connection: ProcessException: adb returned error:
The directory name is invalid.
Could Not Find C:\Users\Mohammed\AppData\Local\Android\sdk\platform-tools\AdbWinApi.dll.dat
Command: C:\Users\Mohammed\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 forward tcp:0 tcp:42601
Error launching application on Android SDK built for x86.
Exited (sigterm)

I solved this issue by the following 3 steps:
1 remove the sdk and emulator.
2 install again the sdk and emulator.
3 restart my computer
and then then solved it

Related

Debug Flutter app is not working with VSCode on Xiaomi Device

I'm starting developing mobile using flutter on vscode IDE. I was debbuging the app using a samsung device, everything was ok, but I tryed debug the app using a xiaomi device, however this time i've got an error
Launching lib/main.dart on 166216e0 in debug mode...
Built build/app/outputs/flutter-apk/app-debug.apk.
adb: insufficient permissions for device: missing udev rules? user is in the plugdev group
See [http://developer.android.com/tools/device.html] for more information
Error: ADB exited with exit code 1
adb: insufficient permissions for device: missing udev rules? user is in the plugdev group
See [http://developer.android.com/tools/device.html] for more information
Error launching application on 166216e0.
Exited (sigterm)
There's a difference of android version. Samsung is android 11 and xiaomi is a MIUI Global 12.0.4 android 10.
apart from having usb debug enabled, i've enabled the option to install via usb and usb debugging.
I don't know how to solve this. Any suggestion?
I've updated SDK Manager adding android 10
after that i runned
flutter doctor --android-licenses
but I still not working

Launch emulator from windows command line receive error G67247B7E

Newbee here. Trying to run the android emulator for the generic first_app flutter application.
Run flutter run -d windows
Receive:
C:\Development\Flutter\first_app>flutter run -d windows
Launching lib\main.dart on Windows in debug mode...
lib/main.dart(60,15): error G67247B7E: Expected ';' after this. [C:\Development\Flutter\first_app\build\windows\flutter\flutter_assemble.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB8066: Custom build for 'C:\Development\Flutter\first_app\build\windows\CMakeFiles\13756e3632117b79f6e0bc292bc438e0\flutter_windows.dll.rule;C:\Development\Flutter\first_app\build\windows\CMakeFiles\f154f6c681490929a1ff6491e40cd6b3\flutter_assemble.rule' exited with code 1. [C:\Development\Flutter\first_app\build\windows\flutter\flutter_assemble.vcxproj]
Building Windows application...
Exception: Build process failed.
Other information:
Flutter Doctor is clean. That took hours.
Running from Android Studio works.
Launching emulator works correctly
Have tried Flutter Clean, Flutter upgrade, Flutter Master.
Have tried running from powershell with the same error.
Any assistance welcomed.
First you can check if the emulator is running or not by this command
flutter devices
Then you can directly run your app through
flutter run -d device-id
In my case, it was
flutter run -d emulator-5554
All, on a whim, I deleted my first_app and created it again via flutter create first_app.
Immediately running flutter run, it works!

Flutter web run in chrome?

Launching lib\main.dart on Chrome in debug mode...
lib\main.dart:1
Failed to launch browser after 3 tries. Command used to launch it: C:\Users\admin\AppData\Local\Google\Chrome\Application\chrome.exe --user-data-dir=C:\Users\admin\AppData\Local\Temp\flutter_tools.d39b26cf\flutter_tools_chrome_device.96f3921c --remote-debugging-port=55848 --disable-background-timer-throttling --disable-extensions --disable-popup-blocking --bwsi --no-first-run --no-default-browser-check --disable-default-apps --disable-translate http://localhost:55815
Failed to launch browser. Make sure you are using an up-to-date Chrome or Edge. Otherwise, consider using -d web-server instead and filing an issue at https://github.com/flutter/flutter/issues.
flutter config --enable-web
Add this

Issue with Flutter commands after Flutter upgrade

My project was working okay before I got Flutter upgrade prompt. After accepting to upgrade flutter, I started getting the following exception and now with every flutter command I get this exception. Also since that problem started Android Studio does not pick up any running emulator. So basically, I'm stuck, please help. It just displays "Loading..." instead of displaying the running Emulator.
Version Information:
Android Studio 3.4.2 • Flutter plugin io.flutter 38.2.1 • Dart plugin 183.6270
I've change the permission for git.EXE to allow for read, execute etc but this has not helped.
ERROR MESSAGE:
CreateProcessW failed 5
Unhandled exception:
ProcessException: Access is denied.
I have faced the same issue after running the flutter upgrade command
Remove exiting flutter SDK from the directory "https://flutter.dev/docs/get-started/install" and download again and run the following command
flutter doctor -v
After running the flutter upgrade command in the Windows CMD I faced the same issue.
I then tried to upgrade Flutter SDK using the Android Studio terminal and it upgraded successfully.

Flutter doesn't launch the app after adding OneSignal. OneSignalNotificationServiceExtension is unknown to FrontBoard

Flutter can't launch my application after adding onesignal to my app. I've followed this guide. After managing all problems I got this one.
When I do flutter run I see the error below:
ProcessException: Process "/usr/bin/xcrun" exited abnormally:
<your-app>.OneSignalNotificationServiceExtension: -1
An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=1):
The request to open "<your-app>.OneSignalNotificationServiceExtension" failed.
The request was denied by service delegate (SBMainWorkspace) for reason: NotFound ("Application
"<your-app>.OneSignalNotificationServiceExtension" is unknown to FrontBoard").
Underlying error (domain=FBSOpenApplicationErrorDomain, code=4):
The operation couldn’t be completed. Application "<your-app>.OneSignalNotificationServiceExtension" is unknown to
FrontBoard.
Application "<your-app>.OneSignalNotificationServiceExtension" is unknown to FrontBoard.
Command: /usr/bin/xcrun simctl launch 26CD3C41-B2F7-4B59-9360-97C9688ABE38
<your-app>.OneSignalNotificationServiceExtension --enable-dart-profiling --enable-checked-mode --observatory-port=0
Error launching application on iPhone 8.
What I've tried:
Relaunching my emulator
Erasing all data on the emulator
Cleaning the build folder
OneSignal version: 1.0.5
flutter --version
Flutter 1.1.8 • channel beta • https://github.com/flutter/flutter.git
Framework • revision 985ccb6d14 (6 weeks ago) • 2019-01-08 13:45:55 -0800
Engine • revision 7112b72cc2
Tools • Dart 2.1.1 (build 2.1.1-dev.0.1 ec86471ccc)
Go to iOS/Runner/Info.plist and set your bundleId in the section CFBundleIdentifier
Your bundle id is here. Copy it.
Paste bundleId into CFBundleIdentifier in the info.plist
Do the same actions in the iOS/OneSignalNotificationServiceExtension/Info.plist
I hope this helps. At least it worked for me.
Note:
BundleId of the OneSignalNotificationServiceExtension has a slightly different id. Check it in xcode before adding it to the .plist of OneSignalNotificationServiceExtension.
Facing the same issue.
ProcessException: ProcessException: Process "/usr/bin/xcrun" exited abnormally:
Failed to install the requested application
The application's Info.plist does not contain CFBundleVersion.
Ensure your bundle contains a CFBundleVersion.
Command: /usr/bin/xcrun simctl install 552DF0B1-4A65-46FE-8125-C2B37F3005DC/example/build/ios/iphonesimulator/Runner.app