3

In Xcode 9.3 my App crashes when I try to open it over an URL scheme (deeplink) like: myapp://somepath

No problems with Xcode 9.2. I have both Xcode versions installed and exactly the same code crashes with Xcode 9.3 but not with Xcode 9.2. The crash happens right before the call arrives to:

AppDelegate.application(UIApplication, open : URL, sourceApplication : String?, annotation : Any) -> Bool

I have set a breakpoint in this function and it will never reach it, it just crashes before. Here the crashlytics log:

http://crashes.to/s/3237f00bf6a

So any ideas what causes this or how to solve it?

Darko
  • 9,655
  • 9
  • 36
  • 48
  • 2
    Please copy and paste the relevant portion of the error and symbolicated stacktrace into your question (as text). – rmaddy Apr 10 '18 at 13:40
  • @rmaddy The linked, already answered, question has a really bad title, so it's hard to find it. I extensively searched on SO before asking my question. I suggest to leave my question so others can find it easier. – Darko Apr 10 '18 at 13:58
  • That's fine. Being closed as a dupe doesn't mean the question should be deleted. BTW - not my down votes. – rmaddy Apr 10 '18 at 14:00
  • @rmaddy I see, thanks. I have no problem with down votes. :) – Darko Apr 10 '18 at 14:13

1 Answers1

12

This is a bug on Swift4.1 https://bugs.swift.org/plugins/servlet/mobile#issue/SR-7240

Workaround is to replace function to following:

func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
andykkt
  • 1,696
  • 16
  • 23