App closes without error or stacktrace silently - flutter

My app consistently crashes at the same location. Should be easy to fix as I could trace the issue down to the exact location. But there is no error message at all. No break occur in debugger. It just crashes completely and silently. No stack, no actual error. App closes and that is it. Tried in 1.13 and 1.17.
Lost connection to device.
Exited (sigterm)
Any idea how to tackle? How to find such error? It is on iOS.

For those who meet a similar issue. Seems native iOS codes won't throw exception. A plugin with a bug may crash your app straight.

Related

Why my app is not closing even after a crash

I am working on an iPad app. Sometimes it get crashed (I know the reason) but I am wondering why the app does not close even after a crash! When the app crash I got some error related to crash in console but the app does not close. It even appear in the multitasking bar (I can see that when I press home button two times). I am wondering is there some kind of setting for this? or this is a normal behavior?
If you are running the App from Xcode, the debugger will still be attached so the crash will not terminate the process. You can use the Xcode debugger to take a look at the stack, inspect variables etc. Only when you stop the app in Xcode will the process be completely terminated.
#Mike Weller is correct.
It is typical behavior of the simulator to not close the app upon a crash as the debugger is designed to stop at the point of code where the crash occurs (for obvious reasons!).
If you want to check it on device for your satisfaction. Connect your device, run the app once on it via xcode. Close app (stop on xcode). Then disconnect the device.
The app will be now installed on your device like any other normal app. Run this app and do whatever causes it to crash. You will see that the app will close and you will be thrown back to the iphone springboard screen.
As for app appearing in the multitasking bar, it has already been mentioned here that the presence of the app in the multitasking bar does not mean that it is still running. This is vital difference in architectures between ios and android.
The multitasking bar is NOT a task manager. The ios philosophy is that the user does not need to know that an app is running or not. He only needs to know which apps he has run in the past.
The reason that it doesn't close, is probably that the app is actually not crashing.
Could it be so that the print you are seeing is an Exception that is printed to the log?
Could it be that you are catching this exception after it is printed?
Like this:
#try {
[test characterAtIndex:6];
}
#catch (NSException * e) {
NSLog(#"Exception: %#", e);
}
The above code would not crash, since the exception is caught. Catching an exception is telling the platform that you took care of the problem so the app does not need to crash.
There could be many other reasons, but with the info you provided this is my best guess.
You could post the log print that you are seeing, that would certainly give a better clue...

SIGABRT on iPhone but not simulator

My IPhone app is suddenly giving a SIGABRT error message when I attempt to run it on my iPhone, before even the first line of the application delegate is reached. It runs fine in the simulator, and even restoring previously working snapshots give the same error when I attempt to load the application on the device.
I fiddled with the Product Name build setting and the data model prior to the problem occurring, but as mentioned, old snapshots that ran fine now won't load, suggesting that the problem isn't in the code.
I have tried restarting xCode, the computer, the iPhone and deleting the app but the problem is still occurring.
I am sure that the problem lies with the device
Any ideas what the problem might be or how I can fix it?
Taking on Till's suggestions I reinstalled iOS (well, actually I updated it to 5.1) and everything is working again. Thanks for the advice. I've no idea what went wrong, but at least its working again now!

Xcode 4 Assertion Error

I am getting an assertion error when I launch Xcode 4, which I just installed. I have looked on Google and Stackoverflow, and I could not find anybody with the same problem as me. As soon as I open Xcode 4, it shows me the welcome screen. I try to open a project, and Xcode gives me a message saying I can continue using Xcode in an inconsistent state or I can crash Xcode. When I click on more details it says "ASSERTION ERROR" followed by some other debugging info. I can't copy it because when I try to highlight it Xcode freezes completely.
Any suggestions?
NOTE: This is different from other people who get this error when they build, I am getting this when it is LAUNCHED.
Could it also be because I am continuing a project from the previous version of Xcode?
[UPDATE] I have solved the problem. If you are also encountering such an error, try reinstalling Xcode 4. If you continue getting the same error, then follow the advice of #mrueg.
Xcode 4 has various bugs, and the assertion error is just a general warning that an inconsistency was detected.
The best way to get more info on the actual error that happened is to crash Xcode when you get the error and then show the details.
It probably also makes sense to send the crash report to Apple so they can fix the bug.
It is probably best to keep using Xcode 3 (which is still downloadable for the newest SDKs) and wait for the next version of Xcode 4 if your project crashes it.

Program exited with status value:255. while debbuging iphone app in device

My app is crashing with an error code - Program exited with status value:255. I can't find any error or stack trace in console. This crash will occur only when the app is installed and executed for the first time. I don't get this error while running the app second time. I searched around the web and found a solution. According to that I changed the Target setting of "Compile for Thumb" to off. Even after I am getting this crash and error.
In my previous versions i don't get this error. I don't know whether any change in the code or settings of Xcode causing this problem.
Any help is highly appreciated.
Thanks,
Adarsh V C.

Application Build not loaded on device

When I tried to upload a build on device it give the following error.
Your mobile device has encountered an unexpected error (0xE8000001)
I am unable to solve this problem. Can anyone tell me why this is happening?
Anytime i get an unexpected error i hard reboot my device by holding down the home and lock buttons until the apple logo appears. No idea what causes it, but the reboot usually fixes it.
This seems to be a bug that is puzzling many users. No idea what the error actually is, but on this forum people claim:
this error will require you to restore your iPhone/touch, either through Xcode's Organizer window or iTunes. No way around it".
This basically happens when there's a communications error between Xcode and the iPhone which leaves Xcode confused about the state the iPhone is in. (You can actually make it happen sometimes by unplugging the phone in the middle of installing a build.) As the error message's text suggests, turning the iPhone off and back on will usually clear the error. You may sometimes have to restart Xcode or even your whole Mac, but not often.
To all
The problem get solved. When I set provisioned profile of device. It works.
Thanks for your help & guideline.