从AppStore或TestFlight启动时应用程序崩溃但其他工作正常 [英] App crashing when launching from AppStore or TestFlight but working fine elseways

查看:2024
本文介绍了从AppStore或TestFlight启动时应用程序崩溃但其他工作正常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序更新已被拒绝。在拒绝消息中,他们写了发布时应用程序崩溃。然后我尝试了我的应用程序,但无法使其崩溃。所以我使用了TestFlight并注意到当我从TestFlight或AppStore启动我的应用程序时,它在启动时崩溃了。但是,如果我正常启动我的应用程序,它确实可以正常运行而不会崩溃。问题是自iOS 10更新以来发生了这个错误。现在我的应用程序在AppStore上启动时也崩溃,而它在2周后工作正常。

My application update has been rejected. Into the rejection message, they wrote "Application crashes at launch". I then tried my application but couldn't make it crash. So I used TestFlight and noticed that when I was launched my app from TestFlight or AppStore, it was crashing at launch. But if I launch my app normally, it does work without any crashes. The thing is this bug occurred since iOS 10 update. Now my application on store also crashes when launched from AppStore while it was working fine 2 weeks go.

Apple发给我一个崩溃日志:

Apple sent me a crash log:

Incident Identifier: 001969F1-F275-4AC3-AFE1-E0426957B702
CrashReporter Key:   5ad9695e945a7d5eb5d61fd18d1c3989ccd155b4
Hardware Model:      xxx
Process:             MyApp [400]
Path:                /private/var/containers/Bundle/Application/644423A4-EFE7-41B1-99D9-47B46338A6E2/MyApp.app/MyApp
Identifier:          com.MyApp.com
Version:             20160527 (2.7.9)
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           com.MyApp.com [451]


Date/Time:           2016-09-22 11:19:22.6893 -0700
Launch Time:         2016-09-22 11:19:22.4164 -0700
OS Version:          iPhone OS 10.0.1 (14A403)
Report Version:      104

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x000000010008a864
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [0]
Triggered by Thread:  0

Filtered syslog:
None found

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0  MyApp                         0x1000efd3c specialized AppDelegate.application(UIApplication, didFinishLaunchingWithOptions : [NSObject : AnyObject]?) -> Bool (AppDelegate.swift:218)
1  MyApp                         0x1000ed310 @objc AppDelegate.application(UIApplication, didFinishLaunchingWithOptions : [NSObject : AnyObject]?) -> Bool (AppDelegate.swift)
2  UIKit                          0x19888c42c <redacted> + 400
3  UIKit                          0x198a9cb70 <redacted> + 3524
4  UIKit                          0x198aa28e0 <redacted> + 1656
5  UIKit                          0x198ab7080 <redacted> + 48
6  UIKit                          0x198a9f8c4 <redacted> + 168
7  FrontBoardServices             0x1945798bc <redacted> + 36
8  FrontBoardServices             0x194579728 <redacted> + 176
9  FrontBoardServices             0x194579ad0 <redacted> + 56
10 CoreFoundation                 0x192986278 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
11 CoreFoundation                 0x192985bc0 __CFRunLoopDoSources0 + 524
12 CoreFoundation                 0x1929837c0 __CFRunLoopRun + 804
13 CoreFoundation                 0x1928b2048 CFRunLoopRunSpecific + 444
14 UIKit                          0x1988855dc <redacted> + 608
15 UIKit                          0x198880360 UIApplicationMain + 208
16 MyApp                         0x1000ee818 main (AppDelegate.swift:58)
17 libdispatch.dylib              0x1918945b8 (Missing)

还有4个其他线程,但这一个是崩溃的,所以我没有复制其余的。我做了一些研究,尽管我确实注意到我的崩溃日志没有完全翻译(因为我有所有的dsyms但是有什么奇怪的原因),我确实理解我在第217行崩溃了(告诉我,如果我'我错了)。我知道SIGTRAP大多数时候都会抛出NSExceptions。该行本身是:

There is 4 others threads but this one is the one crashing so I did not copy the rest. I did some research and even though I did notice my crash log wasn't fully translated (for some strange reason since I have all dsyms but whatever), I did manage to understand that I was crashing on line 217 (tell me if I'm wrong). I know that SIGTRAP are most of time NSExceptions being thrown. The line itself is:

let api = MyAppAPI.instance

该实例是一个单例。我的猜测是实例创建中的某些内容失败了。以下是代码:

The instance is a singleton. My guess is that something into the instance creation is failing. Here is the code:

static var instance: MyAppAPI = {
    return Singleton.instance
}()

class MyAppAPI: Manager {
struct Singleton {
    static var configuration: NSURLSessionConfiguration = {
        var configuration = NSURLSessionConfiguration.defaultSessionConfiguration()
        let version = NSBundle.mainBundle().objectForInfoDictionaryKey("CFBundleShortVersionString") as? String ?? ""
        configuration.HTTPAdditionalHeaders = [
            "Accept": "application/vnd.MyApp.api+json, application/json;q=0.9",
            "User-Agent": "MyApp iOS/\(version)",
            "X-API-Version": "1.0.1"
        ]

        return configuration
        }()

    static var instance = MyAppAPI(configuration: configuration)
    static var baseURL : NSURL! = nil
}

我对这个错误感到非常绝望,我确实尝试了一些没有成功的事情。我在寻找合适的地方吗?有人有解决方案吗?任何形式的帮助将不胜感激。我愿意给任何可以找到我解决方案的人或者帮我找到解决方案!

I'm so desperate about this error, I did try a few things that did not work out. Am I looking into the right place ? Is there anyone with a solution ? Any kind of help would be greatly appreciated. I'm willing to gift anyone that can find me the solution or help me find the solution !

推荐答案

我找到了解决方案我的问题。

I found the solution of my problem.

正如预期的那样,它来自 func应用程序(应用程序:UIApplication,didFinishLaunchingWithOptions launchOptions:[NSObject:AnyObject]?) - > Bool

As expected it was coming from func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool

在函数内部我有让userInfo = launchOpts [UIApplicationLaunchOptionsRemoteNotificationKey]为!的NSDictionary

我把它更改为让userInfo = launchOpts [UIApplicationLaunchOptionsRemoteNotificationKey]为? NSDictionary 然后检查如果userInfo!= nil ,使所有代码运行 userInfo 成支架。

I changed it to let userInfo = launchOpts[UIApplicationLaunchOptionsRemoteNotificationKey] as? NSDictionary and then checked if userInfo != nil to make all the code running userInfointo the bracket.

如果它可以帮助任何人或者是否有人在解决这个问题,请检查你的所有并交换这些到如果需要(在 didFinishLaunchingWithOptions 上),因为从TestFlight / AppStore启动似乎有比安装的应用程序更多的选项(只是一个猜测,不足以宣称它)。

If it helps anyone or if anyone is struggling with this issue, check all yours ! and swap these to ? if needed (on didFinishLaunchingWithOptions) since launching from TestFlight/AppStore seems to have different options than from installed application (just a guess, not pro enough to claim it).

这篇关于从AppStore或TestFlight启动时应用程序崩溃但其他工作正常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆