UIGestureGraphEdge Crash

When I clicked the NavigationBar in my App,it crashed.It only crashes in iOS 10 .The console log is:

Assertion failure in -[UIGestureGraphEdge initWithLabel:sourceNode:targetNode:directed:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3599.6/Source/GestureGraph/UIGestureGraphEdge.m:25

Accepted Reply

I encounter a similar crash. The console log is the same as yours. However, my crash has nothing to do with NavigationBar.

When I tap WKWebView in my app, it crashes immediately.


If I look at the console, the log is

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: targetNode'

and Xcode says that it crashes at UIGestureGraphEdge.m:25


I managed to find a workaround for my crash.


I created WKWebView in +(void)load so that I can just call addSubView in viewDidLoad. This works well in iOS 9 but causes crash in iOS 10.


My solution is that I dispatch_after 1s the creation of WKWebView and bingo, crashes disappear!

Replies

I encounter a similar crash. The console log is the same as yours. However, my crash has nothing to do with NavigationBar.

When I tap WKWebView in my app, it crashes immediately.


If I look at the console, the log is

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: targetNode'

and Xcode says that it crashes at UIGestureGraphEdge.m:25


I managed to find a workaround for my crash.


I created WKWebView in +(void)load so that I can just call addSubView in viewDidLoad. This works well in iOS 9 but causes crash in iOS 10.


My solution is that I dispatch_after 1s the creation of WKWebView and bingo, crashes disappear!

I am also seeing this in the GM when compiled and running against iOS 10.

For me the issue seems to occur when interacting with UIButtons or swiping in UIScrollViews.


Anyone filed a rdar on this?

Any Apple folk have any thoughts on what public classes make use of this private one?

I'm also observing this on the GM seed as well.

I'm observing this crash when tapping the UINavigationBar or when interacting with UIScrollViews.


I'm hoping others chime in on this. Anyone else?

I filed a rdar hopefully it gets eyes on it before Wednesday 😁


http://www.openradar.me/radar?id=4947817642590208

So after much hair pulling and code deletion of every extension/catagory/UIAppearance setup in our app we discovered that the issue in our case was that the root view controller for the app was being initialized in the app delegates init method. We have been able to reproduce this in a sample app. heres the code that breaks.


@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
  var window: UIWindow?
  var controller: UIViewController

  override init() {
       window = UIWindow()
       controller = UINavigationController(rootViewController: UIViewController())
  }
  func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
       window?.rootViewController = controller
       window?.makeKeyAndVisible()

       return true
  }
}


Dont know what changed between iOS 9 and iOS 10 to make this be an issue

Please!Do you have a problem solved

I met the same problem,please help me

So one of our apps got rejected today because of this crash. Feels kind of unfair since it's Apple's fault. For me it's manifesting from any interaction with UI- or WKWebViews.


So you isolated the problem code in this snippet. What does the app delegate look like that doesn't crash?


Did you have any luck resolving the crash in your main app?

Hey, I'm getting the same too (or a similar one), except that I'm still back in Objective-C and C++ land as I'm working with libcinder. Here is a post I made on Cinder's support forum, for reference.

I encountered same issue today, and I will share what I found:


The Issue:

When user touch down on a view contains gestureRecognizers, abort will called:

Assertion failure in -[UIGestureGraphEdge initWithLabel:sourceNode:targetNode:directed:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3599.6/Source/GestureGraph/UIGestureGraphEdge.m:25


Reason:

If I create view and setup gestures in some class's +(void)load method, the issue will occur.

Since +(void)load method is called way before application finish launching,

I suspect this is due to the UIGestureRecognizer's global enviroment is not set up yet.


Solve:

Delay the creation of the view, such as put it in the applicationDidFinishLaunching callback.

This appears to be an order of execution problem. The issue is that there are two many pointers to too many things. the delegate pattern is creating lots of issues because I need to create a delegate object and pass the view object to it. Or, I have to make all the objects be delegates themselves. This greatly affects the flexibility of the software system design.