FLEXTool / FLEX

An in-app debugging and exploration tool for iOS
Other
14.06k stars 1.7k forks source link

Crashes when entering file browser #242

Closed tal closed 5 years ago

tal commented 5 years ago

I just installed FLEX via cocoa pods and when I try to navigate to the file browser my app crashes with this stack trace. Any idea what the issue is? Seems to be the same bug as #237. I don't have any uses of UISearchBar in my codebase

Exception:

2018-11-09 18:57:43.869881-0500 weather-range[78271:5968607] -[UIView setImage:]: unrecognized selector sent to instance 0x7fa7a3f5cd40
2018-11-09 18:57:43.875463-0500 weather-range[78271:5968607] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView setImage:]: unrecognized selector sent to instance 0x7fa7a3f5cd40'
*** First throw call stack:
(
    0   CoreFoundation                      0x00000001087ed1bb __exceptionPreprocess + 331
    1   libobjc.A.dylib                     0x0000000107d8b735 objc_exception_throw + 48
    2   CoreFoundation                      0x000000010880bf44 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
    3   UIKitCore                           0x00000001112edb4a -[UIResponder doesNotRecognizeSelector:] + 287
    4   CoreFoundation                      0x00000001087f1ed6 ___forwarding___ + 1446
    5   CoreFoundation                      0x00000001087f3da8 _CF_forwarding_prep_0 + 120
    6   UIKitCore                           0x0000000110a9c36f -[UISearchBar(UISearchBarStatic) _updateMagnifyingGlassView] + 564
    7   UIKitCore                           0x0000000110a9c4a4 -[UISearchBar(UISearchBarStatic) _setupSearchField] + 249
    8   UIKitCore                           0x0000000110a8e42e -[UISearchBar searchField] + 42
    9   UIKitCore                           0x0000000110a8ef7e -[UISearchBar setPlaceholder:] + 52
    10  UIKitCore                           0x00000001113369c3 -[UISearchController _commonInit] + 343
    11  UIKitCore                           0x0000000111336d4f -[UISearchController initWithSearchResultsController:] + 103
    12  weather-range                       0x00000001047d4b38 -[FLEXFileBrowserTableViewController initWithPath:] + 344
    13  weather-range                       0x00000001047d499c -[FLEXFileBrowserTableViewController initWithStyle:] + 76
    14  weather-range                       0x00000001047d9a2b __54+[FLEXGlobalsTableViewController defaultGlobalEntries]_block_invoke_20 + 59
    15  weather-range                       0x00000001047da069 -[FLEXGlobalsTableViewController viewControllerToPushForRowAtIndexPath:] + 121
    16  weather-range                       0x00000001047da42e -[FLEXGlobalsTableViewController tableView:didSelectRowAtIndexPath:] + 94
    17  UIKitCore                           0x00000001114e4dfd -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1813
    18  UIKitCore                           0x00000001114e5018 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 344
    19  UIKitCore                           0x00000001112cb0d2 _runAfterCACommitDeferredBlocks + 318
    20  UIKitCore                           0x00000001112b9b2c _cleanUpAfterCAFlushAndRunDeferredBlocks + 384
    21  UIKitCore                           0x00000001112e8efc _afterCACommitHandler + 135
    22  CoreFoundation                      0x0000000108751c27 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
    23  CoreFoundation                      0x000000010874c0be __CFRunLoopDoObservers + 430
    24  CoreFoundation                      0x000000010874c751 __CFRunLoopRun + 1537
    25  CoreFoundation                      0x000000010874be11 CFRunLoopRunSpecific + 625
    26  GraphicsServices                    0x000000010cecf1dd GSEventRunModal + 62
    27  UIKitCore                           0x00000001112bf81d UIApplicationMain + 140
    28  weather-range                       0x00000001044d7fa4 main + 68
    29  libdyld.dylib                       0x000000010a691575 start + 1
NSExceptional commented 5 years ago

Debug your app and add a breakpoint on exceptions / errors. Looks like you might be misusing private APIs

tal commented 5 years ago

Hrm, I removed any extensions I had on any UIView or subclasses and still getting the issue.

NSExceptional commented 5 years ago

Well, UIKit is calling setImage: on a UIView. Something that is supposed to be a UIImageView is now a UIView. Comment out anything that messes with UISearchBars

tal commented 5 years ago

Ya, digging it's nothing to do with your codebase, I wonder if one of the other pods I have messes with it. I don't touch anything with UISearchBar. Had that extension in there from when I was. Removed the extension and it's still broken unfortunately. ¯_(ツ)_/¯

Will loop back to this later.

NSExceptional commented 5 years ago

Could you list which pods you're using, out of curiosity? It could be helpful to anyone else having this issue.

And if you can't figure out what's causing it I'd be happy to take a look if it's open source

tal commented 5 years ago

here's my pod file. A cursory search of all the included files shows flex has the only mentions of UISearch

project 'weather-range.xcodeproj'
platform :ios, '10.0'

target 'weather-range' do
  pod 'ReSwift'
  pod 'Alamofire'
  pod 'Then'
  pod 'SwiftyBeaver'
  pod 'Sourcery'
  pod 'Result'
  pod 'Purchases', modular_headers: true
  pod 'FLEX', '~> 2.0', :configurations => ['Debug']
  pod 'ActionKit', '~> 2.3.2'
  pod 'NotificationBannerSwift'
  pod 'Eureka'
  pod 'TimeIntervals'
  pod 'PopupDialog', '~> 0.7'
  pod 'FileKit'
end
NSExceptional commented 5 years ago

Hmmm. Is your codebase open source?