iOS app thread 0 crashed

My app crashed few seconds after I launched RTCVideoRenderer from flutter_webrtc package.

I am new with iOS development, I don't have idea what causing this is error? Anyone can help me?

This is my crash report:

Anyone can help me?

Here are a few things I see after taking a look at your crash log.

  1. Your crash log is not symbolicated. You'll want to do yourself a favor and symbolicate this log to see the execution path of your code. If the correct symbol files are on your system, you can symbolicate a crash log by dropping the crash log into the "Device Logs" section of the Xcode Organizer.

  2. You mentioned the your app crashed shortly after launching a WebRTC package, but it looks like your app has been running for over an hour and when it crashed and it was in the background:

    Date/Time: 2022-04-07 15:09:44.3068 +0200

    Launch Time: 2022-04-07 14:01:25.9777 +0200

    Role: Non UI

    One thing you could try here is just focusing on this code path while your app is in the foreground. Possibly separate this code path out into a focused sample so that it can be debugged immediately after launch?

  3. Something went wrong in either your code or a 3rd party library resulting in an abort call from the system (EXC_CRASH (SIGABRT)). Now, going back to the first point, there is a lot of your project's code and WebRTC's code running on background threads, so you will want ot take a look at what these threads frames reveal by getting this crash log further symbolicated. This should give you next steps in your debugging.

Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com

I cannot symbolicate this crash log using XCode so I am doing it using command line.

The crash report you posted is incomplete — it’s missing the Binary Images section at the end — so no one can symbolicate it.

For advice on how to post crash report, see my Posting a Crash Report post.

On which addresses I should focus?

The addresses in the Last Exception Backtrace section. That indicates that your app crashed because it threw an unhandled language exception, and the Last Exception Backtrace section holds the backtrace of the source of exception.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

This is my full crash report.

I tried to match these addresses from Last Exception Backtrace with binary image but honestly I don't know how.

You have the binary images now at the bottom of your crash log but your code and your 3rd party code is still not symbolicated. You will want to do yourself a favor and symbolicate the crash log. This will allow you to see what execution paths of your code may be involved with the issue.

If the correct symbol files are on your system, you can symbolicate a crash log by dropping the crash log into the "Device Logs" section of the Xcode Organizer.

Otherwise, if worst comes to worst you can symbolicate your crash log by hand if you have the dSYM files. This process is described here. A brief example using atos would look like this:

# Using 0x10039c000 as your load address: 
0x10039c000 - 0x104e67fff Runner arm64  <09637c1ad9b5338382390b2d3f090727> /var/containers/Bundle/Application/13D70FFF-A12B-45D6-8490-25A7FD7ECC03/Runner.app/Runner

----

# Using 0x00000001003a5ac0 as the address to symbolicate from thread 12 of your app:
Thread 12 name:  Dispatch queue: com.apple.avfoundation.videodataoutput.bufferqueue
Thread 12:

0   Runner                        	0x00000001003a5ac0 0x10039c000 + 39616

# Take atos and symbolicate your log:
$ atos -arch arm64 -o <PathToDSYMFile>/Contents/Resources/DWARF/<BinaryName>  -l 0x10039c000 0x00000001003a5ac0
Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com

What Matt said plus…

I did a little manual symbolication of your log and ended up with this:

Last Exception Backtrace:
…
2   CoreFoundation … +[NSException raise:format:] + 116
3   Runner         … 0x000000010039c000 + 18156551

The exception is being thrown directly by your code in frame 3. You really do need to symbolicate that.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I found out what line is causing my error. It's await _qrCodeScanner.processImage(InputImage.fromFile(file)); When code is reaching this point app is crashing. I need permission to access temporary directory or something?

I am using https://pub.dev/packages/google_ml_kit and https://pub.dev/packages/path_provider to get this functions.

_qrCodeScanner = GoogleMlKit.vision
    .barcodeScanner(<BarcodeFormat>[BarcodeFormat.qrCode]);
getTemporaryDirectory().then((value) {
  _tempDir = value;
});
File file = await File('${_tempDir.path}/image.png').create();
file.writeAsBytesSync(frame.asUint8List());

await _qrCodeScanner.processImage(InputImage.fromFile(file));

But I don't found any of GoogleMLKit line in my crash report.

I need permission to access temporary directory or something?

I can’t give definitive answers about third-party libraries. If you need that, escalate via the support channel for the library you’re using.

However, one obvious gotcha here is that, if you’re code uses the camera, it must authorise that access correctly. See the Camera and Microphone section of Protected Resources for the details.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

iOS app thread 0 crashed
 
 
Q