First Flutter App stuck at “Running Gradle task 'assembleDebug'… ” in Llnux Mint - flutter

I'm getting the following error while running my first flutter app in the terminal
Launching lib/main.dart on vivo 1802 in debug mode...
Running Gradle task 'assembleDebug'...
(This is taking an unexpectedly long time.)
I already tried downloading the gradle distribution separately and copy pasting it in my project's gradle wrapper and restarting android studio but it still doesn't resolve the issue.
I'm using Linux Mint 19.

Make sure you have an internet connection.When running an app for the first time, gradle needs to download some additional content
Check your connection to your virtual phone or your phone well. Make sure it doesn't disconnect while you are running the app

Before starting this building process, make sure:
USB debugging is enabled on your phone,
No app is currently running (and you are on your home screen),
While running your app for the first time on a phone, your phone will get a pop-up asking you to allow the installation of apps via USB.
Click 'allow' on it.
Not clicking 'allow' or simply ignoring it will make it seem like the build process is never-ending.

Related

Flutter app stopped working on emulator/simulator (Windows 10 and MacOS)

My flutter project runs on real devices with F5 or with
flutter run --release
on real devices connected to the PC. It also worked on emulators (Windows 10) and simulators (macOS) but it stopped, getting an endless loading screen right after splash screen. On iOS i got this message in the logs:
PET daemon has launched
Failed to initialize PET service. Exiting...
Failed to initialize the tracker
Anyone an idea?
Try these three one by one:
1- flutter clean , flutter doctor (then resolve if there are any errors)
2- Search for dart.flutterAdditionalArgs in your vs code settings.
and remove args against it.
3- go to Android Studio , Uninstall all the sdk tools you have installed ,then reinstall it
I found the issue. It was the internet connection. Tried another one and it works.

Flutter project debug is stopping in my Redmi note 9 phone

Launching lib\main.dart on M2003J15SC in debug mode...
lib\main.dart:1
Plugin project :firebase_core_web not found. Please update settings.gradle.
Invalid depfile: D:\Kampus\Alternative Internship\E-Butler FLutter\history-ebutler-main\.dart_tool\flutter_build\8db1b350320c9cfb508a70518c727e07\kernel_snapshot.d
Parameter format not correct -
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Error waiting for a debug connection: The log reader stopped unexpectedly
Error launching application on M2003J15SC.
Exited (sigterm)
when i press f5 on my vscode the build is success but in my phone only view white screen and then it exited
Just switch off the Turn on MIUI Optimization in your Developer options then run your app.
For some other fixes checkout this.
Your app is installed even if your phone stays on white screen, you can see that it worked by closing and reopening the app from your phone.
This Issue happens on most Xiaomi...Redmi note 10 pro as well this is only when it comes to flutter, if you launch project from root/android it will work fine,
If you use command line flutter run it will also work but you will not get input back from command line after install only difference app is launching
At the moment this is the only worked around
Make sure that your app meets the following requirements:
Targets API level 19 (KitKat) or higher Uses Android 4.4 or higher
https://firebase.google.com/docs/flutter/setup?platform=android
in some android devices not receiving firbase base responce because of its versions and api level
flutter clean, restart your devices, reconnect your devices to your pc and run again, this solution worked for me.

Got the "Error launching application on" after flutter run

I am flowing the official tutorial to install flutter and run the default app on my iPhone Device. After I execute the flutter run, the app is installed and launched on my iPhone but the logs show the bellow error. How do I solve it?
Launching lib/main.dart on My iPhone 6 in debug mode...
Automatically signing iOS for device deployment using specified development team
in Xcode project: XXXXXXXXXX
Running Xcode build...
└─Compiling, linking, and signing... 50.2s
Xcode builds done. 90.1s
Installing and launching... 41.1s
Error launching the application on My iPhone 6. <-- Error Here
It happens that there are some process needed to Flutter plugin correctly run on physical devices. I struggled with that and finally found that the processes idevicesyslog and iproxy were being silently blocked by MacOS.
You may have noticed already a message liked this:
or a similar one for idevicesyslog.
Once I went to System Preferences -> Security & Privacy in General tab and allowed this apps, everything works. Note that this screen shows only the last app that you tried to run. So I'd recommend that you run flutter app with preferences opened so you can (hopefully) see the messages appearing and click allow.
MacOS may warn you one more time about the file being downloaded from the internet. Just click open and you're good.
The error do not show again after reboot the iPhone.
Same error -- Running fine through Xcode, when I ran with flutter CLI, the app would open, but the terminal log output would crash with the error as in the post.
I ran flutter update and simultaneously turned iPhone off and back on. After doing that, the below popup appeared (on mac).
I believe after the install finished, I ran the below (which I ran several times before updating flutter and installing the popup):
flutter clean
rm -rf ios/Pods
flutter pub get
cd ios && pod install && cd ..
run the flutter app using flutter run from command line, then the MacBook will ask for permission to open the app and app runs,
(lldb) warning: libobjc.A.dylib is being read from process memory. This indicates that LLDB could not find the on-disk shared cache for this device. This will likely reduce debugging performance.
Error launching application on device-XXXXX.
Building & Replace with a newest version ios-deploy solved problems list aboved. Flutter SDK bundled a pre-built command ios-deploy in __PATH_TO_YOUR_Flutter_SDK_/bin/cache/artifacts/ios-deploy/, just replace it.
Please reference to: Flutter Error launching application on device issue .

Gradle Android-Studio: deploy / run on multiple devices parallel

I came from Intellij (and ANT) and there I can run an apk if more than one devices are connected. Then I get a chooser dialog with all connected devices(offline and online).
Now I work with Android-Studio and gradle and if I deploy with run or whatever (installDebug, clean etc.), it deploys automatically on the device (and AFTER deploying on device i get the chooser dialog). If I connected more than one device, than he faild the build with the message "more than one device".
Its possible with configuration in Android-studio, compile or gradle task or in build.gradle to get again the chooser dialog with all connected devices again? I loved the intellij Feature for deploying one apk on multiple devices parallel.
Thanks
In the "Choose Device" dialog that comes up to let you choose a physical device or emulator instance to run your app on, you can choose multiple items from the list:
If you're not seeing this dialog, it's possible you clicked the "Use same device for future launches" button in the dialog. Go into the run configuration and reset the settings under "Target Device".
Check that your android devices have a different serial number.
Use
adb devices
to list serial number of connected devices.
Since they(IDEs) all use adb under the hood, I think the message "more than one device" is thrown from adb when it failed to uniquely identify devices.
In my deploy prozess i used the gradle statements gradle run, install or clean. This are Tasks, there deploy automatically. i use now assemble gradle task and now it works, sorry for confusing

Unable to launch Android emulator from Eclipse/Linux

I'm using Eclipse Juno (build 20120920-0800) on openSUSE 12.2 to code Android applications.
I have installed the SDK by uncompressing it into my home directory (if I install the SDK via YaST package I can't download stuff unless I'm root). I installed ADT from Eclipse Marketplace, configured the path of the SDK and configured a couple of emulator configurations.
I can run and debug fine on my phone, and I guess the same applies to my tablet even if I haven't tried yet.
The real problem is that I can't run the emulator. Clicking on the bacarozzo debug icon prompts me to run the application on the device but doesn't show me available emulators.
If I open the device manager I'm shown with the virtual devices I created but I can't just start any. The progress bar reaches the end, I see no emulator screen and if I try to delete the emulator I'm warned that the instance is running... (OK in the screenshot there is only one, I already managed to delete the other)
I urge to test some GUI features in an outdated version of Android. I have done all the field tests of the business logic code in my program on a JB device and I know for sure that code works on any device.
Now I only need to be backward-compatible with preferences and layouts.
How can I start the emulator in Linux?
Just by luck I managed to run the emulator from console
djechelon#RAYNOR:~/android-sdk-linux/tools> ./emulator-arm -avd Emulator_cell
It came to life and Eclipse debug is detecting it as active device