应用程序从ipa文件崩溃但从Xcode运行良好?

时间:2017-03-18 05:58:50

标签: swift xcode crash ipa

当我直接从Xcode运行我的项目到我的设备时,它运行完美,没有任何崩溃。但是当我创建该项目的ipa文件并使用iTunes将ipa安装到我的设备中时,当我点击登录按钮时它会崩溃,之后会有很多尝试登录,之后就可以了。

如果在互联网上提到这个问题它对我没有帮助。这是我推荐的链接

App works fine with developer build with xcode. But crashes when run using ipa file

Gameplay Crashes From ipa file but runs fine from Xcode?

我不明白实现ipa文件的实际问题是什么。 当我直接从Xcode运行它时它为什么不崩溃。当作为ipa或从Xcode运行时,是否存在任何代码压缩或不同的代码编译机制。

任何帮助都将不胜感激。

崩溃日志

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libswiftCore.dylib      0x00000001010b25dc 0x100f74000 + 1304028
1   AppName                 0x00000001001030c4 0x1000bc000 + 291012
2   Appname                 0x00000001001062cc 0x1000bc000 + 303820
3   Alamofire               0x00000001004c9c9c 0x10047c000 + 318620
4   Alamofire               0x00000001004c899c 0x10047c000 + 313756
5   Alamofire               0x0000000100486d08 0x10047c000 + 44296
6   libdispatch.dylib       0x000000018571e1fc 0x18571d000 + 4604
7   libdispatch.dylib       0x000000018571e1bc 0x18571d000 + 4540
8   libdispatch.dylib       0x0000000185722d68 0x18571d000 + 23912
9   CoreFoundation          0x0000000186842810 0x186765000 + 907280
10  CoreFoundation          0x00000001868403fc 0x186765000 + 898044
11  CoreFoundation          0x000000018676e2b8 0x186765000 + 37560
12  GraphicsServices        0x0000000188222198 0x188216000 + 49560
13  UIKit                   0x000000018c7b57fc 0x18c73b000 + 501756
14  UIKit                   0x000000018c7b0534 0x18c73b000 + 480564
15  AppName                 0x0000000100139e4c 0x1000bc000 + 515660
16  libdyld.dylib           0x00000001857515b8 0x18574d000 + 17848

Thread 1:
 0   libsystem_kernel.dylib 0x0000000185863a88 0x185844000 + 129672
 1   libsystem_pthread.dylib    0x0000000185927344 0x185926000 + 4932
 2   libsystem_pthread.dylib    0x0000000185926d8c 0x185926000 + 3468

Thread 2:
 0   libsystem_kernel.dylib 0x0000000185863a88 0x185844000 + 129672
 1   libsystem_pthread.dylib    0x0000000185927160 0x185926000 + 4448
 2   libsystem_pthread.dylib    0x0000000185926d8c 0x185926000 + 3468

 Thread 3:
 0   libsystem_kernel.dylib   0x0000000185863a88 0x185844000 + 129672
 1   libsystem_pthread.dylib    0x0000000185927344 0x185926000 + 4932
 2   libsystem_pthread.dylib    0x0000000185926d8c 0x185926000 + 3468

Thread 4:
0   libsystem_kernel.dylib    0x0000000185863a88 0x185844000 + 129672
1   libsystem_pthread.dylib     0x0000000185927344 0x185926000 + 4932
2   libsystem_pthread.dylib     0x0000000185926d8c 0x185926000 + 3468

Thread 5 name:  com.apple.uikit.eventfetch-thread
Thread 5:
0   libsystem_kernel.dylib      0x0000000185845188 0x185844000 + 4488
1   libsystem_kernel.dylib      0x0000000185844ff8 0x185844000 + 4088
2   CoreFoundation            0x00000001868425d0 0x186765000 + 906704
3   CoreFoundation            0x00000001868401ec 0x186765000 + 897516
4   CoreFoundation            0x000000018676e2b8 0x186765000 + 37560
5   Foundation                0x00000001872ab26c 0x18729f000 + 49772
6   Foundation                0x00000001872cbdd0 0x18729f000 + 183760
7   UIKit                   0x000000018d129c38 0x18c73b000 + 10415160
8  Foundation                0x00000001873a8e68 0x18729f000 + 1089128
9  libsystem_pthread.dylib    0x0000000185929850 0x185926000 + 14416
10  libsystem_pthread.dylib    0x0000000185929760 0x185926000 + 14176
11  libsystem_pthread.dylib    0x0000000185926d94 0x185926000 + 3476

Thread 6:
0   libsystem_kernel.dylib   0x0000000185862e1c 0x185844000 + 126492
1   libsystem_pthread.dylib  0x00000001859289c0 0x185926000 + 10688
2   libc++.1.dylib           0x00000001852513ec 0x18524a000 + 29676
3   JavaScriptCore           0x000000018b0725d0 0x18a799000 + 9278928
4   JavaScriptCore           0x000000018b072544 0x18a799000 + 9278788
5   JavaScriptCore           0x000000018b072424 0x18a799000 + 9278500
6   JavaScriptCore           0x000000018b0726d4 0x18a799000 + 9279188
7   libsystem_pthread.dylib  0x0000000185929850 0x185926000 + 14416
8   libsystem_pthread.dylib  0x0000000185929760 0x185926000 + 14176
9   libsystem_pthread.dylib  0x0000000185926d94 0x185926000 + 3476

Thread 7 name:  com.apple.NSURLConnectionLoader
Thread 7:
0   libsystem_kernel.dylib    0x0000000185845188 0x185844000 + 4488
1   libsystem_kernel.dylib    0x0000000185844ff8 0x185844000 + 4088
2   CoreFoundation            0x00000001868425d0 0x186765000 + 906704
3   CoreFoundation            0x00000001868401ec 0x186765000 + 897516
4   CoreFoundation            0x000000018676e2b8 0x186765000 + 37560
5   CFNetwork                 0x0000000186f73a70 0x186e94000 + 916080
6   Foundation               0x00000001873a8e68 0x18729f000 + 1089128
7   libsystem_pthread.dylib   0x0000000185929850 0x185926000 + 14416
8   libsystem_pthread.dylib    0x0000000185929760 0x185926000 + 14176
9   libsystem_pthread.dylib    0x0000000185926d94 0x185926000 + 3476

Thread 8 name:  JIT Worklist Worker Thread
Thread 8:
0   libsystem_kernel.dylib  0x0000000185862e1c 0x185844000 + 126492
1   libsystem_pthread.dylib 0x00000001859289c0 0x185926000 + 10688
2   libc++.1.dylib          0x00000001852513ec 0x18524a000 + 29676
3   JavaScriptCore          0x000000018b05ad64 0x18a799000 + 9182564
4   JavaScriptCore          0x000000018ae32a5c 0x18a799000 + 6920796
5   JavaScriptCore          0x000000018ae32eac 0x18a799000 + 6921900
6   JavaScriptCore          0x000000018a7a300c 0x18a799000 + 40972
7   JavaScriptCore          0x000000018a7a2f1c 0x18a799000 + 40732
8   libsystem_pthread.dylib 0x0000000185929850 0x185926000 + 14416
9   libsystem_pthread.dylib 0x0000000185929760 0x185926000 + 14176
10  libsystem_pthread.dylib 0x0000000185926d94 0x185926000 + 3476

 Thread 9 name:  WTF Parallel Helper Thread
 Thread 9:
0   libsystem_kernel.dylib    0x0000000185862e1c 0x185844000 + 126492
1   libsystem_pthread.dylib   0x00000001859289c0 0x185926000 + 10688
2   libc++.1.dylib            0x00000001852513ec 0x18524a000 + 29676
3   JavaScriptCore           0x000000018b05ad64 0x18a799000 + 9182564
4   JavaScriptCore           0x000000018b05a2e8 0x18a799000 + 9179880
5   JavaScriptCore          0x000000018b05a088 0x18a799000 + 9179272
6   JavaScriptCore          0x000000018a7a300c 0x18a799000 + 40972
7   JavaScriptCore          0x000000018a7a2f1c 0x18a799000 + 40732
8   libsystem_pthread.dylib  0x0000000185929850 0x185926000 + 14416
9   libsystem_pthread.dylib  0x0000000185929760 0x185926000 + 14176
10  libsystem_pthread.dylib  0x0000000185926d94 0x185926000 + 3476

 Thread 10 name:  com.apple.CoreMotion.MotionThread
 Thread 10:
 0   libsystem_kernel.dylib    0x0000000185845188 0x185844000 + 4488
 1   libsystem_kernel.dylib    0x0000000185844ff8 0x185844000 + 4088
 2   CoreFoundation           0x00000001868425d0 0x186765000 + 906704
 3   CoreFoundation           0x00000001868401ec 0x186765000 + 897516
 4   CoreFoundation           0x000000018676e2b8 0x186765000 + 37560
 5   CoreFoundation           0x00000001867bbb44 0x186765000 + 355140
 6   CoreMotion               0x000000018d631120 0x18d5c3000 + 450848
 7   libsystem_pthread.dylib  0x0000000185929850 0x185926000 + 14416
 8   libsystem_pthread.dyli   0x0000000185929760 0x185926000 + 14176
 9   libsystem_pthread.dylib  0x0000000185926d94 0x185926000 + 3476

Thread 0 crashed with ARM Thread State (64-bit):
 x0: 0x0000000101524380   x1: 0x00000001702f4d00  
    x2:0x0000000000000008   x3: 0x00000001858a922c
x4: 0x0000000000000014   x5: 0x0000000000000010   x6: 
    0x0000000000000000   x7: 0x0000000000000600
x8: 0x00000001702f4900   x9: 0x00000001702f4900  x10:    
    0x0000000000000001  x11: 0xbaddc0dedeadbead
x12: 0x0000010000000100  x13: 0x206e6120676e6970  x14: 
    0x6c616e6f6974704f  x15: 0x000a65756c617620
x16: 0x00000001858996b0  x17: 0x0000000000000000  x18: 
    0x0000000000000000  x19: 0x0000000170442eb0
x20: 0x0000000170e67400  x21: 0x0000000000000000  x22: 
    0x0000000000000000  x23: 0x0000000000000014
x24: 0x00000001ac178d20  x25: 0x0000000000000000  x26: 
    0xffffffffffffffff  x27: 0x0000000170e67400
x28: 0x0000000002ffffff   fp: 0x000000016fd415b0   lr: 
    0x00000001010b25dc
sp: 0x000000016fd415a0   pc: 0x00000001010b25dc cpsr: 0x20000000

感谢

3 个答案:

答案 0 :(得分:5)

你应该看一下崩溃的日志。

  1. 将您的设备连接到Mac
  2. 在Xcode中,按cmd + shift + 2。
  3. 找到您的设备,然后按日志按钮
  4. 等一会儿。然后你可以看到所有崩溃的日志。
  5. 找到您的应用名称。如果您不理解,请在此处发布。

答案 1 :(得分:4)

我也经历了同样的问题

您必须编辑您的计划

存档 - >构建配置 - >将其设置为Debug 现在尝试归档和测试您的IPA ..它应该可以正常工作。

答案 2 :(得分:0)

我假设您使用Debug配置构建具有不同构建配置的应用程序,当您从Xcode运行它时,Release配置用于部署为ipa。我们在发布配置中遇到了类似的无法解释的bug问题,并发现Swift Optimization导致了这个问题。目前,我们已针对发布版本从Fast, Whole Module Optimization切换到Fast, Single-File Optimization,直到我们可以缩小问题范围。

希望有所帮助!

enter image description here