【问题标题】:iOS8 Beta 3 SpriteKit exc_bad_acces when running on deviceiOS 8 Beta 3 SpriteKit exc_bad_access 在设备上运行时
【发布时间】:2014-07-11 06:42:46
【问题描述】:

我目前正在使用SwiftSpritekit 中开发一个应用程序。该应用程序在设备和模拟器中完美运行,直到我更新到 Xcode 6 Beata 3 和 iOS 8 Beta 3。当我在模拟器中运行该应用程序时,一切仍然完美。但是当我创建SKTextureAtlas 时,在设备上运行应用程序会导致exc_bad_acces。有没有人面临类似的问题,或者任何人都可以帮我解决这个问题。

我已经尝试在装有 iOS8 Beta 2 的设备上运行它,但我在这里遇到了同样的错误。我还删除了该应用程序,但这也没有解决我在设备上运行该应用程序时的问题。

这里是它崩溃的地方:

var atlas = SKTextureAtlas(named: "ImageSet")

这是来自设备的日志:

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

谢谢

【问题讨论】:

  • 没有崩溃日志?检查...没有源代码?检查地球上最通用的错误消息?检查...是的,这个问题无法回答。
  • 同意;如果没有堆栈跟踪和相关代码,我们将无能为力。
  • 好的,抱歉。稍后我将使用代码和崩溃日志对其进行更新。但我不在家自动取款机。我认为这将毫无用处,因为该应用程序在模拟器中运行并且在我更新到 Beta 3 之前确实运行过,而没有对代码进行任何更改。到目前为止感谢
  • 在 Beta 3 中似乎对 Swift 进行了很多更改。
  • 我已经用崩溃日志和它崩溃的行更新了我的帖子

标签: ios swift sprite-kit xcode6


【解决方案1】:

尝试在项目上运行 Clean,一些人在更新时遇到了访问错误的问题,包括我在内。有些人用干净的方式解决了这个问题,有些人用项目的新副本解决了这个问题。

【讨论】:

  • 非常感谢!使用 Command-Option-Shift-K 清理 Build 文件夹解决了我的问题!
猜你喜欢
  • 2017-02-05
  • 1970-01-01
  • 2014-07-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多