当我在真实设备 iOS 中运行它时应用程序崩溃

穆罕默德

当我在 Xcode 8.3 上使用 Alamofire 网络时,我正在开发一个应用程序,当我在模拟器中使用 Alamofire 代码时,它正在工作,但是当我在具有 10.2 iOS 版本的真实设备 iPhone 7 中尝试我的代码时,应用程序停止并获取

fatal error: unexpectedly found nil while unwrapping an Optional value 

还有这个断点异常

libswiftCore.dylib`function signature specialization <preserving fragile attribute, Arg[2] = Dead, Arg[3] = Dead> of Swift._fatalErrorMessage (Swift.StaticString, Swift.StaticString, file : Swift.StaticString, line : Swift.UInt, flags : Swift.UInt32) -> Swift.Never:
    0x101b003d0 <+0>:   stp    x26, x25, [sp, #-0x50]!
    0x101b003d4 <+4>:   stp    x24, x23, [sp, #0x10]
    0x101b003d8 <+8>:   stp    x22, x21, [sp, #0x20]
    0x101b003dc <+12>:  stp    x20, x19, [sp, #0x30]
    0x101b003e0 <+16>:  stp    x29, x30, [sp, #0x40]
    0x101b003e4 <+20>:  add    x29, sp, #0x40            ; =0x40 
    0x101b003e8 <+24>:  mov    x19, x6
    0x101b003ec <+28>:  mov    x20, x5
    0x101b003f0 <+32>:  mov    x21, x4
    0x101b003f4 <+36>:  mov    x22, x3
    0x101b003f8 <+40>:  mov    x23, x2
    0x101b003fc <+44>:  mov    x24, x1
    0x101b00400 <+48>:  mov    x25, x0
    0x101b00404 <+52>:  adr    x8, #0xf11fc              ; protocol descriptor for Swift._DefaultCustomPlaygroundQuickLookable + 136
    0x101b00408 <+56>:  nop    
    0x101b0040c <+60>:  add    x0, x8, #0x10             ; =0x10 
    0x101b00410 <+64>:  mov    w1, #0x28
    0x101b00414 <+68>:  orr    w2, wzr, #0x7
    0x101b00418 <+72>:  bl     0x101b00750               ; swift_rt_swift_allocObject
    0x101b0041c <+76>:  mov    x8, x0
    0x101b00420 <+80>:  stp    x22, x21, [x8, #0x10]
    0x101b00424 <+84>:  strb   w20, [x8, #0x20]
    0x101b00428 <+88>:  str    w19, [x8, #0x24]
    0x101b0042c <+92>:  adr    x3, #0x40440              ; partial apply forwarder for Swift.(_fatalErrorMessage (Swift.StaticString, Swift.StaticString, file : Swift.StaticString, line : Swift.UInt, flags : Swift.UInt32) -> Swift.Never).(closure #2)
    0x101b00430 <+96>:  nop    
    0x101b00434 <+100>: mov    x0, x25
    0x101b00438 <+104>: mov    x1, x24
    0x101b0043c <+108>: mov    x2, x23
    0x101b00440 <+112>: mov    x4, x8
    0x101b00444 <+116>: bl     0x1019e14dc               ; function signature specialization <preserving fragile attribute, Arg[1] = [Closure Propagated : reabstraction thunk helper from @callee_owned (@unowned Swift.UnsafeBufferPointer<Swift.UInt8>) -> () to @callee_owned (@unowned Swift.UnsafeBufferPointer<Swift.UInt8>) -> (@out ()), Argument Types : [@callee_owned (@unowned Swift.UnsafeBufferPointer<Swift.UInt8>) -> ()]> of generic specialization <preserving fragile attribute, ()> of Swift.StaticString.withUTF8Buffer <A> ((Swift.UnsafeBufferPointer<Swift.UInt8>) -> A) -> A
->  0x101b00448 <+120>: brk    #0x1

这是我运行的代码

Alamofire.request(APIKeys().login, method: .post, parameters: ["email" : email , "password"  : password ], encoding: JSONEncoding.default , headers: APIKeys().headers).responseJSON(completionHandler: {( response  ) in
            if response.result.value != nil {
                print(response)
             let json = JSON(response.result.value ?? "")
            if json["status"].intValue  == 200
            {
                UserDefaults().set(json["email"].stringValue, forKey: "email")
                UserDefaults().set(json["id"].intValue, forKey: "userID")


            }


            }


        } )
穆罕默德

刚刚清理了缓存并重新安装了应用程序,它在设备上运行良好

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Angular和Ionic,HTTP Get无法在真实设备IOS中工作

在真实设备上使用openCV框架编译iOS应用时出错

Xamarin.UITests-在真实设备上进行测试-iOS-应用权限弹出窗口问题

Android Studio未显示我的真实设备以调试应用

如何在真实设备上的iOS 10中将Gradient应用于UIView

如何在React Native项目上的iOS真实设备中调试?

如何使用Appium在真实设备上自动执行第三方ios应用程序

我无法连接到真实设备的离子3G应用程序

如何在iOS模拟器或真实设备上测试Gluon应用程序?

iOS 13 SwiftUI:应用在真实设备上启动时崩溃

Firebase Phone Auth在iOS模拟器或真实设备中的flutter应用程序中均不起作用

在真实设备上选取PDF时,iOS Document Picker崩溃

在真实设备上运行Android应用程序

使用键盘时,Android应用程序在真实设备上崩溃

我无法在真实设备上的IOS8中的应用程序中仅显示简单的UIActionSheet

在performBlock中重置我的NSManagedObjectContext时,iOS 8应用程序崩溃

IOS App在iTunes版本上崩溃,但在本地模拟器和真实设备测试中运行良好

无法从真实设备运行应用

SafariLauncher应用程序,用于使用Appium在Safari上的iOS真实设备上测试自动化是否必要?

AFNetworking有时无法在真实设备上的iOS 8和9上运行

如何在真实设备上捆绑和部署React-Native iOS应用

当应用程序在ios中崩溃时,我们可以显示警报吗?

无法在真实设备上的iOS 10上运行Appium测试

我的应用程序在真实设备上遇到问题

无法使用 Windows 10 机器在 iOS 真实设备上运行 appium 测试

Android 应用程序在真实设备上安装后崩溃,但在模拟器中运行良好

当我在模拟器中运行它时,应用程序不断崩溃

如何在真实设备上安装 iOS 应用程序以实现 iOS 测试自动化?

尝试使用 vs 代码在真实设备上运行我的 flutter 应用程序