I am currently developing an app in Spritekit with Swift. The app worked perfectly on device and in the simulator until I updated to Xcode 6 Beata 3 and iOS 8 Beta 3. When I run the app in the simulator everything still works perfect. But running the app on the device causes a exc_bad_acces when I create a SKTextureAtlas. Is anyone facing a similar problem or can anyone help me how to solve this.
I've alredy tried to run it on a device with iOS8 Beta 2 but I run into the same error here. I also deleted the app but that also didn't solve my problem when running the app on a device.
Here is the place it crashes:
var atlas = SKTextureAtlas(named: "ImageSet")
and that is the log from the device:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0xfffffffc
Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libswift_stdlib_core.dylib 0x003a737e 0x286000 + 1184638
1 My Game 0x000f6900 Swift._doesImplicitlyUnwrappedOptionalHaveValue <A>(#inout A!) -> Builtin.Int1 (ComputerPlayer.swift:0)
2 My Game 0x0011c0a0 #!objc ObjectiveC.SKTextureAtlas.__allocating_init (ObjectiveC.SKTextureAtlas.Type)(named : Swift.String!) -> ObjectiveC.SKTextureAtlas (SpriteKit-1CMA4777KYE20.pcm:1)
3 My Game 0x0010e010 My_Game.GameScene.didMoveToView (My_Game.GameScene)(ObjectiveC.SKView) -> () (GameScene.swift:132)
4 My Game 0x00113218 #objc My_Game.GameScene.didMoveToView (My_Game.GameScene)(ObjectiveC.SKView) -> () (GameScene.swift:0)
5 SpriteKit 0x2e6d6340 SKGenerateNormalMap + 65680
6 SpriteKit 0x2e6f02de SKGenerateNormalMap + 172078
7 My Game 0x0011fd38 My_Game.GameViewController.viewWillLayoutSubviews (My_Game.GameViewController)() -> () (GameViewController.swift:71)
8 My Game 0x00121468 #objc My_Game.GameViewController.viewWillLayoutSubviews (My_Game.GameViewController)() -> () (GameViewController.swift:0)
9 UIKit 0x2e844266 0x2e837000 + 53862
10 QuartzCore 0x2e2804c0 CABackingStoreGetTypeID + 892
11 QuartzCore 0x2e27bea0 CARenderServerGetServerPort + 5364
12 QuartzCore 0x2e27bd28 CARenderServerGetServerPort + 4988
13 QuartzCore 0x2e27b70c CARenderServerGetServerPort + 3424
14 QuartzCore 0x2e27b510 CARenderServerGetServerPort + 2916
15 UIKit 0x2eaa6cf8 _UIApplicationIsExtension + 4936
16 UIKit 0x2eaa79e0 _UIApplicationIsExtension + 8240
17 UIKit 0x2eab1a68 _UIApplicationUsesAlternateUI + 38388
18 UIKit 0x2eaa5ec8 _UIApplicationIsExtension + 1304
19 FrontBoardServices 0x319bd04e _FBSLog + 2198
20 CoreFoundation 0x2b1692d2 CFRunLoopTimerSetTolerance + 5878
21 CoreFoundation 0x2b168594 CFRunLoopTimerSetTolerance + 2488
22 CoreFoundation 0x2b166d16 _CFRunLoopGet2b + 2174
23 CoreFoundation 0x2b0b624c CFRunLoopRunSpecific + 472
24 CoreFoundation 0x2b0b605e CFRunLoopRunInMode + 102
25 UIKit 0x2e8ab5ba _UISharedImageSetLoadFactor + 3906
26 UIKit 0x2e8a6844 UIApplicationMain + 1436
27 My Game 0x0012a940 top_level_code (AppDelegate.swift:0)
28 My Game 0x0012a97c main (AppDelegate.swift:0)
29 libdyld.dylib 0x385aaaac _tlv_atexit + 8
Thank you
Try running Clean on the project, a few people had problems with bad access, me included, when updating. Some resolved it with clean and some withe a fresh copy of the project.
Related
I found XCode Organizer Crash Report many crashes.The Top is Following:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000156
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [0]
Triggered by Thread: 0
Thread 0 name:
Thread 0 Crashed:
0 ios 0x000000010107e9bc GameObject::IsActive() const + 16 (GameObject.cpp:425)
1 ios 0x00000001013bb168 UI::CanvasManager::AddDirtyRenderer(UI::Canvas*, UI::CanvasRenderer*) + 36 (GameObject.h:575)
2 ios 0x00000001013bba08 UI::CanvasRenderer::SetMesh(Mesh*) + 440 (CanvasRenderer.cpp:572)
3 ios 0x000000010142b32c CanvasRenderer_CUSTOM_SetMesh(Il2CppObject*, Il2CppObject*) + 68 (CanvasRendererBindings.gen.cpp:296)
4 ios 0x0000000100b515cc Graphic_DoMeshGeneration_m2913299565 + 988 (Bulk_UnityEngine.UI_0.cpp:27200)
5 ios 0x0000000100b50c98 Graphic_Rebuild_m2617722358 + 92 (GeneratedVirtualInvokers.h:25)
6 ios 0x0000000100b458bc CanvasUpdateRegistry_PerformUpdate_m2200492017 + 904 (Bulk_UnityEngine.UI_0.cpp:18024)
7 ios 0x0000000100f02854 RuntimeInvoker_Void_t1841601450(MethodInfo const*, void*, void**) + 28 (Il2CppInvokerTable.cpp:3647)
8 ios 0x0000000101962460 il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**) + 68 (Runtime.cpp:497)
9 ios 0x0000000101358bc8 scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExc... + 100 (ScriptingApi_Il2Cpp.cpp:213)
10 ios 0x00000001013516e0 ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool) + 60 (ScriptingInvocation.cpp:303)
11 ios 0x00000001013bb45c UI::CanvasManager::WillRenderCanvases() + 60 (ScriptingInvocation.h:71)
12 ios 0x0000000101253010 PlayerLoop() + 1036 (PlayerLoop.cpp:197)
13 ios 0x00000001014cfc54 UnityPlayerLoopImpl(bool) + 32 (LibEntryPoint.mm:221)
14 ios 0x000000010008268c UnityRepaint + 140 (UnityAppController+Rendering.mm:268)
15 ios 0x0000000100082578 -[UnityAppController(Rendering) repaintDisplayLink] + 88 (UnityAppController+Rendering.mm:77)
16 QuartzCore 0x000000018a222f24 CA::Display::DisplayLinkItem::dispatch(unsigned long long) + 44 (CADisplay.mm:1899)
17 QuartzCore 0x000000018a222dd0 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 444 (CADisplay.mm:1334)
18 IOKit 0x000000018723a094 IODispatchCalloutFromCFMessage + 372 (IOKitLib.c:1190)
19 CoreFoundation 0x0000000186f62e50 __CFMachPortPerform + 180 (CFMachPort.c:682)
20 CoreFoundation 0x0000000186f7b218 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56 (CFRunLoop.c:1959)
21 CoreFoundation 0x0000000186f7a9cc __CFRunLoopDoSource1 + 436 (CFRunLoop.c:2078)
22 CoreFoundation 0x0000000186f784b0 __CFRunLoopRun + 1840 (CFRunLoop.c:3028)
23 CoreFoundation 0x0000000186ea62b8 CFRunLoopRunSpecific + 444 (CFRunLoop.c:3113)
24 GraphicsServices 0x000000018895a198 GSEventRunModal + 180 (GSEvent.c:2245)
25 UIKit 0x000000018ceed7fc -[UIApplication _run] + 684 (UIApplication.m:2650)
26 UIKit 0x000000018cee8534 UIApplicationMain + 208 (UIApplication.m:4092)
27 ios 0x000000010007c690 main + 160 (main.mm:33)
28 libdyld.dylib 0x0000000185e895b8 start + 4
I search for a few days but have no idea.
Environment:
Unity 5.6.4p1
Xcode 11.3
il2cpp
Devices:
iPhone 6
iPhone 6s
iPhone 6p
iPhone 7
iPad 5
iPad 6
also a little parts on iPhone XS、XS Max
iOS version:
9-13.x
I can't reproduce on local device, so can't confirm wether it's fixed.
Hope someone can help.
This looks like a bug (DISABLING UI CRASHES AT GAMEOBJECT::ISACTIVE), try to upgrade Unity to the latest stable version.
EDIT: This appears to be resolved on iOS 13. Leaving all the original details below.
I'm getting a crash when instantiating my CMMotionManager object for Core Motion. This is on an iPhone Xs running iOS 12.0.1.
I can reliably reproduce this with a single-view app, with the following view controller.
import UIKit
import CoreMotion
class ViewController: UIViewController {
var motion: CMMotionManager?
override func viewDidLoad() {
super.viewDidLoad()
// This causes a crash on iPhone Xs, iOS 12.0.1
self.motion = CMMotionManager()
}
}
Full sample project is at https://github.com/doctorcolinsmith/motiontestcrash/tree/master
When running the above, I am getting a fault on a thread with the following output in the debugger.
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 3634, TID: 630341, Thread name: com.apple.CoreMotion.MotionThread, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
Backtrace:
4 libobjc.A.dylib 0x000000019b0d3894 <redacted> + 56
5 CoreMotion 0x00000001a19337a4 CoreMotion + 305060
6 CoreMotion 0x00000001a1933cd8 CoreMotion + 306392
7 CoreMotion 0x00000001a1933be8 CoreMotion + 306152
8 CoreMotion 0x00000001a19653cc CoreMotion + 508876
9 CoreMotion 0x00000001a196542c CoreMotion + 508972
10 CoreFoundation 0x000000019be6c888 <redacted> + 28
11 CoreFoundation 0x000000019be6c16c <redacted> + 276
12 CoreFoundation 0x000000019be67470 <redacted> + 2324
13 CoreFoundation 0x000000019be66844 CFRunLoopRunSpecific + 452
14 CoreFoundation 0x000000019be675a8 CFRunLoopRun + 84
15 CoreMotion 0x00000001a1964d64 CoreMotion + 507236
16 libsystem_pthread.dylib 0x000000019bae1a04 <redacted> + 132
17 libsystem_pthread.dylib 0x000000019bae1960 _pthread_start + 52
18 libsystem_pthread.dylib 0x000000019bae9df4 thread_start + 4
2018-10-24 16:19:31.423680-0700 motiontest[3634:630341] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 3634, TID: 630341, Thread name: com.apple.CoreMotion.MotionThread, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
Backtrace:
4 libobjc.A.dylib 0x000000019b0d3894 <redacted> + 56
5 CoreMotion 0x00000001a19337a4 CoreMotion + 305060
6 CoreMotion 0x00000001a1933cd8 CoreMotion + 306392
7 CoreMotion 0x00000001a1933be8 CoreMotion + 306152
8 CoreMotion 0x00000001a19653cc CoreMotion + 508876
9 CoreMotion 0x00000001a196542c CoreMotion + 508972
10 CoreFoundation 0x000000019be6c888 <redacted> + 28
11 CoreFoundation 0x000000019be6c16c <redacted> + 276
12 CoreFoundation 0x000000019be67470 <redacted> + 2324
13 CoreFoundation 0x000000019be66844 CFRunLoopRunSpecific + 452
14 CoreFoundation 0x000000019be675a8 CFRunLoopRun + 84
15 CoreMotion 0x00000001a1964d64 CoreMotion + 507236
16 libsystem_pthread.dylib 0x000000019bae1a04 <redacted> + 132
17 libsystem_pthread.dylib 0x000000019bae1960 _pthread_start + 52
18 libsystem_pthread.dylib 0x000000019bae9df4 thread_start + 4
(lldb)
Has anyone encountered this before or have an idea on how to solve the crash?
Well, I've tested your application both physical iPhone 6S and iPhone 7 - obviously with iOS 12.0.1. I've also checked for a couple of things in your project and couldn't reproduce your problem at all - not even in simulators - and I don't think it's possible to download a simulator with specific fixes (12.0.x), only with minor version updates - so 12.1 being the next one. This looks really specific on iPhone XS hardware, and I would suggest you to fill an issue with Apple support.
EDIT: Well, I saw that you've already filled a bug report on openradar. This guy even referenced the bug report status on openradar-mirror.
I don't know much about CoreMotion, but the error message tells you you're trying to call a UI action on a background thread. Try putting your code into:
DispatchQueue.main.async {
//your code here
}
It also seems you're trying to do UI related actions in viewDidLoad(). Technically that's fine, but remember that some views probably aren't layed out at that point in time.
After upgrading to XCode 9 I suddently get the following warning when I run my app:
Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 15473, TID: 773864, Thread name: com.google.Maps.LabelingBehavior, Queue name: com.apple.root.default-qos.overcommit, QoS: 21
Backtrace:
4 App 0x000000010b8ee524 GMSIsApplicationInBackground + 53
5 App 0x000000010b8dc77a -[GMSForegroundDispatchQueue initWithName:targetQueue:] + 269
6 App 0x000000010b9bc5ee _ZN7gmscore6vector4text8GlyphSetC2ERKNS_4base10reffed_ptrINS0_16TextureAtlasPoolEEEPU28objcproto17OS_dispatch_queue8NSObjectPK8__CTFontff + 344
7 App 0x000000010b9bba58 _ZN7gmscore6vector4text10GlyphCache11GetGlyphSetEPK8__CTFontf + 214
8 App 0x000000010b9b950e _ZN7gmscore6vector4text6GLText14PrefetchGlyphsERKNS_4base10reffed_ptrINS1_10GlyphCacheEEERKNSt3__16vectorItNS9_9allocatorItEEEEPK8__CTFontf + 22
9 App 0x000000010b9b9611 _ZN7gmscore6vector4text6GLText14PrefetchGlyphsERKNS_4base10reffed_ptrINS1_10GlyphCacheEEEPK8__CTLinebf + 207
10 App 0x000000010b9112df _ZN7gmscore6vector12GLPointLabel22PrefetchGlyphsForGroupEPNS0_12GLLabelGroupE + 181
11 App 0x000000010b911207 _ZN7gmscore6vector12GLPointLabel14PrefetchGlyphsEv + 33
12 App 0x000000010b98022a _ZN7gmscore6vector16LabelingBehavior23CreatePendingOperationsERKNSt3__13setINS_4base10reffed_ptrINS0_7GLLabelEEENS2_4lessIS7_EENS2_9allocatorIS7_EEEESE_SE_NS0_13LabelDrawModeE + 1096
13 App 0x000000010b97fb9d _ZN7gmscore6vector16LabelingBehavior14RunLabelingJobERKNS_4base10reffed_ptrINS1_11LabelingJobEEE + 357
14 App 0x000000010b97fa2a ___ZN7gmscore6vector16LabelingBehavior14CommitInternalEPNS_8renderer14EntityRendererE_block_invoke + 22
15 Foundation 0x0000000110bb0948 __NSThreadPerformPerform + 334
16 CoreFoundation 0x00000001117af2b1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
17 CoreFoundation 0x000000011184ed31 __CFRunLoopDoSource0 + 81
18 CoreFoundation 0x0000000111793c19 __CFRunLoopDoSources0 + 185
19 CoreFoundation 0x00000001117931ff __CFRunLoopRun + 1279
20 CoreFoundation 0x0000000111792a89 CFRunLoopRunSpecific + 409
21 Foundation 0x0000000110b6ae5e -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 274
22 App 0x000000010b9bace5 -[GMSx_GTMSimpleWorkerThread main] + 337
23 Foundation 0x0000000110b788ac __NSThread__start__ + 1197
24 libsystem_pthread.dylib 0x000000011323393b _pthread_body + 180
25 libsystem_pthread.dylib 0x0000000113233887 _pthread_body + 0
26 libsystem_pthread.dylib 0x000000011323308d thread_start + 13
Error Domain=kCLErrorDomain Code=0 "(null)"
I can narrow it down to the problem happens when I assign the map to my view.
override func viewDidLoad() {
super.viewDidLoad()
UIApplication.shared.isIdleTimerDisabled = true
GPSManager.instance.startGPS()
setupLayout()
map = GMSMapView.map(withFrame: CGRect.zero, camera: getCamera(location: initialLocation, zoom: 10))
map.mapType = .hybrid
map.delegate = self
map.settings.consumesGesturesInView = false
self.view.addSubview(map) <-- This is where is goes wrong
self.view.sendSubview(toBack: map)
configureMenus()
}
Is this something I can fix or is it inside Google Maps? Cheers
The problem is inside the Google library.
If you don't want this kind of warning you can disable Main Thread Checker inside the Scheme options.
Go Product > Scheme > Manage Schemes search the Scheme you use for your tests and press Edit... in the left sidebar press Run and then go to Diagnostics and uncheck Main Thread Checker checkbox.
This is only a temporal solution if you don't want these warnings. I do not recommend it because you could introduce bugs if call UI inside a background thread
If you have test you should disable the checkbox in Test option as I explained in Xcode 9, iOS 11, XCUITest failure: Main Thread Checker Flurry Analytics if you do not want the tests crash
Since 3rd beta of iOS 11 my app has started crashing when initialising a MPVolumeView used for AirPlay. The following piece of code is working perfectly fine on earlier versions of iOS and iOS 11 beta 1 and 2.
func setupAirplayButton() {
let rect = CGRect(x: -1000, y: -1000, width: 10, height: 10)
volumeView = MPVolumeView(frame: rect) //app crashes here
volumeView.showsVolumeSlider = false
volumeView.setRouteButtonImage(nil, for: .normal)
volumeView.translatesAutoresizingMaskIntoConstraints = false
volumeView.isHidden = true
if let airplayButton = volumeView.subviews.filter({$0 is UIButton }).first as? UIButton {
self.airplayButton = airplayButton
self.airplayButton?.addObserver(self, forKeyPath: "alpha", options: [.initial, .new], context: nil)
}
NotificationCenter.default.addObserver(self, selector: #selector(wirelessRouteActiveChanged), name: NSNotification.Name.MPVolumeViewWirelessRouteActiveDidChange, object: nil)
myView.addSubview(volumeView)
}
Is anyone else experiencing the same issue?
Edit:
Crash log
Exception Type: EXC_CRASH (SIGTRAP)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: MyApp [4543]
Triggered by Thread: 0
Application Specific Information:
BUG IN CLIENT OF LIBDISPATCH: trying to lock recursively
Filtered syslog:
None found
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x000000018050b4fc (anonymous namespace)::AutoreleasePoolPage::AutoreleasePoolPage(+ 161020 (anonymous namespace)::AutoreleasePoolPage*) + 28
1 libobjc.A.dylib 0x000000018050b294 (anonymous namespace)::AutoreleasePoolPage::autoreleaseFullPage(objc_object*, + 160404 (anonymous namespace)::AutoreleasePoolPage*) + 60
2 libobjc.A.dylib 0x000000018050b294 (anonymous namespace)::AutoreleasePoolPage::autoreleaseFullPage(objc_object*, + 160404 (anonymous namespace)::AutoreleasePoolPage*) + 60
3 libobjc.A.dylib 0x0000000180508e48 objc_object::rootAutorelease2+ 151112 () + 124
4 CoreUI 0x0000000188a71a48 -[CUICommonAssetStorage renditionInfoForIdentifier:] + 188
5 CoreUI 0x0000000188a7c408 -[CUIStructuredThemeStore _canGetRenditionWithKey:isFPO:lookForSubstitutions:] + 152
6 CoreUI 0x0000000188aa5854 -[CUICatalog _resolvedRenditionKeyFromThemeRef:withBaseKey:scaleFactor:deviceIdiom:deviceSubtype:displayGamut:layoutDirection:sizeClassHorizontal:sizeClassVertical:memoryClass:graphicsClass:graphicsFallBackOrder:iconSizeIndex:] + 2112
7 CoreUI 0x0000000188aa5010 -[CUICatalog _resolvedRenditionKeyForName:scaleFactor:deviceIdiom:deviceSubtype:displayGamut:layoutDirection:sizeClassHorizontal:sizeClassVertical:memoryClass:graphicsClass:graphicsFallBackOrder:withBaseKeySelector:] + 308
8 CoreUI 0x0000000188aa3d7c -[CUICatalog _namedLookupWithName:scaleFactor:deviceIdiom:deviceSubtype:displayGamut:layoutDirection:sizeClassHorizontal:sizeClassVertical:] + 176
9 CoreUI 0x0000000188aa406c -[CUICatalog namedLookupWithName:scaleFactor:deviceIdiom:deviceSubtype:displayGamut:layoutDirection:sizeClassHorizontal:sizeClassVertical:] + 156
10 UIKit 0x000000018b4b4ca0 __139-[_UIAssetManager imageNamed:scale:gamut:layoutDirection:idiom:userInterfaceStyle:subtype:cachingOptions:sizeClassPair:attachCatalogImage:]_block_invoke + 256
11 UIKit 0x000000018b4b4ae4 -[_UIAssetManager imageNamed:scale:gamut:layoutDirection:idiom:userInterfaceStyle:subtype:cachingOptions:sizeClassPair:attachCatalogImage:] + 224
12 UIKit 0x000000018b4b5310 -[_UIAssetManager imageNamed:withTrait:] + 576
13 UIKit 0x000000018acbc6cc +[UIImage imageNamed:inBundle:compatibleWithTraitCollection:] + 220
14 UIKit 0x000000018aa7cb74 +[UIImage+ 465780 (UIImagePrivate) imageNamed:inBundle:] + 152
15 MediaPlayer 0x0000000191c36890 -[MPVolumeView _defaultRouteButtonImageAsSelected:] + 120
16 MediaPlayer 0x0000000191c36704 -[MPVolumeView _createSubviews] + 888
17 MediaPlayer 0x0000000191c35288 -[MPVolumeView _initWithStyle:] + 204
18 MediaPlayer 0x0000000191c35370 -[MPVolumeView initWithFrame:style:] + 80
19 MyFramework 0x0000000101b59a84 #nonobjc MPVolumeView.init() + 645764 (ViewController.swift:0)
20 MyFramework 0x0000000101b3a83c MPVolumeView.__allocating_init() + 518204 (ViewController.swift:0)
21 MyFramework 0x0000000101b39b90 ViewController.setupAirplayButton() + 514960 (ViewController.swift:337)
22 MyFramework 0x0000000101b341a4 ViewController.viewDidAppear(_:) + 491940 (ViewController.swift:132)
23 MyFramework 0x0000000101b341f4 #objc ViewController.viewDidAppear(_:) + 492020 (ViewController.swift:0)
24 UIKit 0x000000018aa32e44 -[UIViewController _setViewAppearState:isAnimating:] + 852
25 UIKit 0x000000018aa9c64c __64-[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:]_block_invoke + 44
26 UIKit 0x000000018aa9c5e8 -[UIViewController _executeAfterAppearanceBlock] + 92
27 UIKit 0x000000018ac8a368 _runAfterCACommitDeferredBlocks + 556
28 UIKit 0x000000018ac7d8b4 _cleanUpAfterCAFlushAndRunDeferredBlocks + 288
29 UIKit 0x000000018ac95614 __34-[UIApplication _firstCommitBlock]_block_invoke_2 + 152
30 CoreFoundation 0x0000000180f85f24 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 20
31 CoreFoundation 0x0000000180f85718 __CFRunLoopDoBlocks + 288
32 CoreFoundation 0x0000000180f83440 __CFRunLoopRun + 852
33 CoreFoundation 0x0000000180ea5bf0 CFRunLoopRunSpecific + 436
34 GraphicsServices 0x0000000182cfffac GSEventRunModal + 100
35 UIKit 0x000000018aa7dec4 UIApplicationMain + 208
36 MyApp 0x000000010164a558 main + 189784 (AppDelegate.swift:14)
37 libdyld.dylib 0x00000001809ca1e0 start + 4
This appears to be a problem in the simulator. Running on the device causes no issues.
Same here. The funny part: it‘s working on the iPad Pro (12“) but crashing on the iPhone (7 plus).
Tried instantiating with/without frame, by class name, via ObjC at different moments.
When I keep tapping (starting) the app multiple times it actually won’t crash at some point, but the volume view instance is missing in the view hierarchy.
I guess we have to wait for the next beta to fix this issue. :-/
iOS 11 beta 4 fixed the crash issues for my app.
I don‘t see the UISlider itself though.
I have a custom keyboard for iOS that uses Firebase for analytics. The Firebase app configuration is done at the initializer with a dispatch_once clause with the token as a global variable.
var token: dispatch_once_t = 0
class KeyboardViewController: UIInputViewController {
// ..
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
dispatch_once(&token) {
FIRApp.configure()
} // line 90
}
// ..
}
This is working fine but I am receiving many crash reports that indicate crashes on many devices when the app is configured. I am stuck for days trying to figure out the cause. Here is a part of one of the crash reports stack trace:
Exception Type: EXC_CRASH (SIGQUIT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Quit: 3
Termination Reason: Namespace SIGNAL, Code 0x3
Terminating Process: launchd [1]
Triggered by Thread: 0
Thread 0 name:
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x000000018fab6338 __semwait_signal_nocancel + 8
1 libsystem_c.dylib 0x000000018f9e20dc nanosleep$NOCANCEL + 200 (nanosleep.c:104)
2 libsystem_c.dylib 0x000000018fa0568c sleep$NOCANCEL + 44 (sleep.c:62)
3 libsystem_dnssd.dylib 0x000000018fa6e7d4 ConnectToServer + 832 (dnssd_clientstub.c:607)
4 libsystem_dnssd.dylib 0x000000018fa6ff44 DNSServiceCreateConnection + 76 (dnssd_clientstub.c:1785)
5 libsystem_network.dylib 0x000000018fb2d318 __nw_resolver_set_update_handler_block_invoke + 872 (resolver.m:1031)
6 libdispatch.dylib 0x000000018f9711c0 _dispatch_client_callout + 16 (object.m:455)
7 libdispatch.dylib 0x000000018f97e860 _dispatch_barrier_sync_f_invoke + 84 (queue.c:3457)
8 libsystem_network.dylib 0x000000018fb2ce78 nw_resolver_set_update_handler + 208 (resolver.m:1275)
9 SystemConfiguration 0x0000000190f8a16c __SCNetworkReachabilityRestartResolver + 260 (SCNetworkReachability.c:1711)
10 SystemConfiguration 0x0000000190f891c8 __SCNetworkReachabilitySetDispatchQueue + 764 (SCNetworkReachability.c:1823)
11 SystemConfiguration 0x0000000190f88ccc SCNetworkReachabilityScheduleWithRunLoop + 504 (SCNetworkReachability.c:1586)
12 CustomKeyboard 0x000000010013f630 -[FIRReachabilityChecker start] + 196
13 CustomKeyboard 0x000000010013abac -[FIRNetwork init] + 156
14 CustomKeyboard 0x0000000100132e28 -[FIRClearcutLogger init] + 416
15 CustomKeyboard 0x0000000100132c68 __35+[FIRClearcutLogger sharedInstance]_block_invoke + 36
16 libdispatch.dylib 0x000000018f9711c0 _dispatch_client_callout + 16 (object.m:455)
17 libdispatch.dylib 0x000000018f971fb4 dispatch_once_f + 56 (once.c:57)
18 CustomKeyboard 0x0000000100132c40 +[FIRClearcutLogger sharedInstance] + 108
19 CustomKeyboard 0x0000000100137214 +[FIRApp initClearcut] + 60
20 CustomKeyboard 0x0000000100136688 +[FIRApp configureDefaultAppWithOptions:sendingNotifications:] + 132
21 CustomKeyboard 0x000000010013643c +[FIRApp configure] + 316
22 libdispatch.dylib 0x000000018f9711c0 _dispatch_client_callout + 16 (object.m:455)
23 libdispatch.dylib 0x000000018f971fb4 dispatch_once_f + 56 (once.c:57)
24 CustomKeyboard 0x00000001000e314c _TFC19CustomKeyboard22KeyboardViewControllercfT7nibNameGSqSS_6bundleGSqCSo8NSBundle__S0_ + 1500 (KeyboardViewController.swift:90)
25 CustomKeyboard 0x00000001000e3270 _TToFC19CustomKeyboard22KeyboardViewControllercfT7nibNameGSqSS_6bundleGSqCSo8NSBundle__S0_ + 112 (KeyboardViewController.swift:0)
26 UIKit 0x00000001971f7688 -[_UIViewServiceViewControllerOperator __createViewController:withContextToken:fbsDisplays:appearanceSerializedRepresentations:legacyAppearance:traitCollection:initialInterfaceOrientation:hostAccessibilityServerPort:canShowTextServices:replyHandler:] + 2216 (UIViewServiceViewControllerOperator.m:1732)
27 CoreFoundation 0x0000000190aee160 __invoking___ + 144
28 CoreFoundation 0x00000001909e1c3c -[NSInvocation invoke] + 284 (NSForwarding.m:2948)
29 CoreFoundation 0x00000001909e66ec -[NSInvocation invokeWithTarget:] + 60 (NSForwarding.m:3019)
Apparently, the call trace after calling FIRApp.configure() is going through system libraries.
One observation from the stack trace is that the crash has something to do with checking the reachability of the device. However, I tried to reproduce a scenario where there is no internet connection but it's working fine.
Please note that all the crashes are happening on iOS 10 and most of them on iPhone 6.
Any help to figure out the cause of the crashes would be appreciated.
It is not recommended to use Firebase Analytics in an extension as the SDK does not support extension well. App extensions have limited functionalities compared to a full app so Firebase Analytics may not work well under some conditions, like the network in this case. The team is looking into supporting extensions better later.
It seems like the network is not available on custom keyboard as stated by Apple
"By default, a keyboard has no network access and cannot share a
container with its containing app. To enable these things, set the
value of the RequestsOpenAccess Boolean key in the Info.plist file to
YES. Doing this expands the keyboard’s sandbox, as described in
Designing for User Trust."
https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/CustomKeyboard.html#//apple_ref/doc/uid/TP40014214-CH16-SW1