Crash on CarPlay | Community
Skip to main content
Answered

Crash on CarPlay

  • Aug 18, 2022 11:16 AM UTC
  • 11 replies
  • 908 views

Hi, the SDK crash if I try to start a CarPlay app.

 

The error is

 

[CPTemplateApplicationScene windows]: unrecognized selector sent to instance 0x1228ef470

 

The error is thrown from login method:

 

Intercom.loginUser(with: attributes, completion: nil)

Best answer by User1891

I believe this issue is caused by the SDK assuming that all scenes returned from `UIApplication.shared.connectedScenes` are `UIWindowScene`’s, but that is not the case.

I suspect that this issue could be fixed by filtering to only the connected scenes like so:

let windowScenes = UIApplication.shared.connectedScenes.compactMap { $0 as? UIWindowScene }

// Now each window scene will have a windows property
// which you can access without crashing.
_ = windowScenes.first?.windows

Here is a temporary workaround that consumers of the SDK can use while waiting for a fix:

extension CPTemplateApplicationScene {
@objc var windows: UIWindow? { nil }
}

It works by defining the missing property and exposing it to Objective-C.

View original

11 replies

  • Author
  • New Participant
  • Aug 19, 2022 8:39 AM UTC

Hi, I created a simple project to replicate the problem. You can find it here https://github.com/cbarbera80/carplay_test_issue/p>


Racheal
Intercom Team
Forum|alt.badge.img+7
  • Customer Support Engineer
  • Aug 23, 2022 1:36 AM UTC

Hey @claudio​ Racheal from the Support Engineer team 👋🏼

 

After doing some more digging on my end, I see that this is a bug that our engineers have been notified of and are currently looking into. Could you write into the team via the Messenger or team@intercom.io so we can get you added to the issue? This way we can notify you with any updates!

 

I appreciate your patience as we look into this.


  • Author
  • New Participant
  • Sep 20, 2022 4:18 PM UTC

hi @racheal​ , are there any updates regarding the crash that occurs on carplay?


  • New Participant
  • Sep 28, 2022 11:53 AM UTC

Hi folks,

 

We at Zetland are also experiencing this issue.

As it stands right now, we're actually blocked on releasing our CarPlay-integration because of this, so we're really looking forward to a solution.

 

Thank you.

Anders


  • New Participant
  • Oct 5, 2022 3:46 PM UTC

We've also been running into the same issue ever since migrating our CarPlay app to the new Apple framework. Unfortunately it seems Intercom has no urgency in making their product usable on iOS so we've started researching alternatives.


Daniel M15
Employee
Forum|alt.badge.img+5
  • Employee
  • Oct 5, 2022 4:37 PM UTC

Hey everyone, Daniel from Customer Support Engineering here 👋

 

I can confirm that our engineers are continually working towards a solution to resolve the current issue with our SDK and CarPlay. Our team are currently working on a number of items, such as other bug fixes, forthcoming releases, updates, and helping out Support members with customer queries, so it is not currently possible for me to give an exact ETA on this issue.

 

I totally understand how problematic this bug is, and we know that this is an urgent request for many of our users. Please be assured that this is currently being developed and we hope to see a resolution for this ASAP. Thank you all for your continued patience in the meantime, it has not gone unnoticed and it is much appreciated 🙏


  • Author
  • New Participant
  • Oct 6, 2022 3:32 PM UTC

https://forum.intercom.com/s/question/0D52G00004r3ii9SAA/intercom-causes-crash-on-ios-if-carplay-is-started/p>

 

Hi thanks for the reply. As you can see from this other report, this problem dates back to two years ago. It is not acceptable that such a bug has been around for that long, especially if it has already been reported. We will also evaluate different alternatives to your platform that will ensure greater stability and readiness for bug resolution.


  • New Participant
  • Nov 8, 2022 5:23 PM UTC

This crash still happens on Intercom 14.0.0.

 

Congrats to everyone involved in this release! 😐


  • New Participant
  • Answer
  • Sep 15, 2023 10:04 PM UTC

I believe this issue is caused by the SDK assuming that all scenes returned from `UIApplication.shared.connectedScenes` are `UIWindowScene`’s, but that is not the case.

I suspect that this issue could be fixed by filtering to only the connected scenes like so:

let windowScenes = UIApplication.shared.connectedScenes.compactMap { $0 as? UIWindowScene }

// Now each window scene will have a windows property
// which you can access without crashing.
_ = windowScenes.first?.windows

Here is a temporary workaround that consumers of the SDK can use while waiting for a fix:

extension CPTemplateApplicationScene {
@objc var windows: UIWindow? { nil }
}

It works by defining the missing property and exposing it to Objective-C.


  • New Participant
  • Nov 4, 2023 1:24 AM UTC

Crash is still happening… what's going on Intercom team?


  • New Participant
  • Dec 14, 2023 4:28 PM UTC

Just adding a +1 to this, we are facing the same issue. 

The temp workaround mentioned above by User1891 is working for us at the moment. Thank you so much for suggesting!

extension CPTemplateApplicationScene {
@objc var windows: UIWindow? { nil }
}