3

Exactly 60 seconds after launching my app it crashes with an uncaught exception:

libc++abi.dynlib: terminating app due to uncaught exception of type NSException 
 *** Terminating app due to uncaught exception of type 'NSInvalidArgumentException', reason: '*** -[__NSDictionaryM setObject:forKey:]: object cannot be nil (key: BundleVersion)'

The crashing thread has a random number (it is #7 in the attached screenshot) and it is always created for an unknown to me queue glmtl.telemetry.

The crash occurs only on one device (iPhone 11 Pro Max) and iOS 14.0 (it was then replicated with iOS 14.0.1).

I am not using in the project anywhere a key "BundleVersion". (There is CFBundleVersion in the info.plist, but does not seem to be related).

Can this be caused by the project sources?

enter image description here

agirault
  • 2,509
  • 20
  • 24
Greg
  • 442
  • 4
  • 16

2 Answers2

1

This is not an explanation of the issue but the crash stopped appearing after adding a group of missing resource files to a folder (not a group but a folder) in the bundle.

Greg
  • 442
  • 4
  • 16
1

Fix

I am having the same issue. In my case, I needed to add CFBundleVersion to the project's Info.plist since the exception mentions the "BundleVersion" key and because I recalled seeing XCode complain about invalid bundles when that key is missing.

My guess is that those recommended CFBundle* keys should be set for the main project's Info.plist and any embedded framework or projects with their own Info.plist. I'm just surprised XCode 12 doesn't raise that error right now at build time.

Source of the issue (?)

Do you use OpenGL in your app? I could not find what glmtl is, but it seems that the crash occurs exactly 1 minute after I instantiate a new OpenGL context. The crash will still occur after 1 minute if I delete the context before that, but it will be delayed another minute if I create a new instance in between.

agirault
  • 2,509
  • 20
  • 24
  • 1
    Yes, I use OpenGL. The queue's name ```gltml``` suggest some relationship to ```OpenGL / Metal```. The crash stopped occurring after fixing a git issue - one folder with assets had a question mark in the project navigator ```[?]```. Seems completely unrelated, but it helped. – Greg Oct 08 '20 at 20:31
  • In my project `CFBundleVersion` was set to `$(CURRENT_PROJECT_VERSION)`. After I rewrote this value to the actual number (for example "3"), the crashes stopped. But every time when you set bundle version in Project tab, it will rewrite the value in info.plist back to `$(CURRENT_PROJECT_VERSION)`, which again trigger the crash :((( – Mike Keskinov Nov 24 '20 at 13:10
  • @mike-keskinov yes that's annoying... Apple/XCode seem to want to enforce `CURRENT_PROJECT_VERSION` as the value of `CFBundleVersion`, though you can always revert the change and it will still work with a hardcoded value... However, it should still work as long `CURRENT_PROJECT_VERSION` is set (which should be under "TARGETS > YourApp > General > Identity > Build"). Do you see `CURRENT_PROJECT_VERSION` equal to anything if you inspect your `project.pbxproj` file? – agirault Nov 25 '20 at 14:35