Got the "Error launching application on" after flutter run - flutter

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 .

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.

app-release is not installed in real device Flutter

I am releasing apk this way(shown on image)
I have release apk file from build/flutter/Build apk but is not installed in any real devices and its give me error "App is not installed as package appears to be invalid". Can you please help me how to solve this error I am stuck in this problem. This app is run nicely in debug mode from run command.
I have tried this solution:
Uninstall old app and then tried to installed this app
Restart real device and then tried to install this app
Create new apk release file and tried.
Flutter clean and Flutter get done.
Tried to install more than 5 devices but same error in every real device.

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.

DeviceInfo native module is not installed correctly

So I tried implementing Facebook Login and followed all the steps accordingly. After having errors with FBSDKcorekit/FBSDKcorekit.h' file not found, I decided to pivot over to working on other components.
Lo' and behold, I have this error giving me trouble now. I followed along with this video: https://www.youtube.com/watch?v=rAXVKapP5cM&t=458s where I used the react-native install react-native-fbsdk and react-native link react-native-fbsdk commands in my terminal.
If it helps, I'm getting the following compile error in my terminal:
The following build commands failed:
CompileC /Users/someUser/desiredProject/ios/build/Build/Intermediates/RCTFBSDK.build/Debug-iphonesimulator/RCTFBSDK.build/Objects-normal/x86_64/RCTFBSDKGraphRequestManager.o RCTFBSDK/core/RCTFBSDKGraphRequestManager.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
I'm not sure if it was the tinkering around with the react-native-fbsdk or making links to it that caused this error. Note my project was working before I was trying to implement Facebook Login and using the link command.
What's going on here?
Thanks in advance for your time and patience.
edit: Also I did not implement any of the Facebook login code yet since I couldn't get a successful build on Xcode.
#kdizzle Make sure you have the right packager running in the terminal, sometimes you may have a packager associated with another react native project running, this happens because when you stop running an xcode RN project, it doesn't stop the packager in the terminal, and when you start/open another RN project in xcode, it simply checks if a packager is running, doesn't check if it's associated with the current project. So make sure you stop all of the packager instances in the terminal and then open the RN project again.
This may happen when upgrading a project to a newer version of react-native. To fix it,
Stop your packager.
Quit your iOS/android simulator.
Reinstall your modules: rm -rf node_modules && npm install
Restart your packager and simulator, e.g. react-native run-ios
I had this issue and it happened when I changed Hardware within the simulator. To fix it I had to kill the packager and run 'react-native run-ios' again. It didn't happen all the time but when it did this fixed it for me!
Another use is in a Brownfield App. Check your iOS and/or Android react-native versions. If they don't match exactly you will see this error screen too.
For example: I had a react native instance running 0.45.1 while Android had 0.45.0 installed. The solution for me was to make sure everything was running the same version.
None of the above answers have worked for me, so I researched the 'react-native' options a little and ended up:
Deleting the iOS and android folders from the app directory altogether
Running 'react-native eject'
Re-running 'react-native run-ios'
After that the iPhone emulator seemed to have no problem with the app.
This problem would appear when React Native libraries in ios project can not found.
I happend to meet this problem when i update my react-native version from 0.42 to 0.44, and cause that a file named RCTConvert+Map disappear in 0.44, so i update my pod.
command: pod update

My Ionic app works fine on browser but does not open in my phone

my ionic project works fine with ionic serve --lab ,but while copied the.apk file in build folder to my phone and install the app but blank screen appears ,
Please can anyone suggest what might be my problem
my app is using google maps,key is provieded for both app and browser in index.html
Have you tried running it in the emulator ? Since its much easier to see the error logs . Try ionic emulate android -l or ios -l (whichever OS you are building for) and then once the execution starts run the command consolelogs it will log all the activity and you will have a better understanding about why its not working.
+1 for using Chrome Remote Debugging feature. It give you the same output as you would receive from running you app in the browser.
Additionally, I have found that sometimes if your app is already compiled, the ionic CLI doesnt always copy your current files into the APK, and uses the older cached files instead. If you are banging your head against the wall, run the following commands to make sure you have your latest code in your APK.
ionic platform remove android
ionic platform add android
ionic run android
I suggest you use the Chrome Remote Debugging feature. I encountered the same, and looked for answers to my symptom for hours. Once I connected to the chrome remote debugger, I got the console.log back, and noticed there was a problem in my routing setup.
It was a problem with ionic CLI. I've updated it to the latest and reinstalled all dependencies.