单击贝宝时,Ionic 3 IOS 应用程序崩溃
Posted
技术标签:
【中文标题】单击贝宝时,Ionic 3 IOS 应用程序崩溃【英文标题】:Ionic 3 IOS application crash when click on paypal 【发布时间】:2018-10-29 04:46:55 【问题描述】:step 1
step 2
This is the error I am getting on clicking paypal button
error
此应用在 android 上运行良好。但是在ios上崩溃了。 Build by IONIC 3. 如何解决这个问题? 租用按钮将重定向到 PayPal。使用 PayPal 沙盒帐户。 请帮忙。谢谢
2018-05-21 13:04:03.754557+0530 thegrand[665:8151] DiskCookieStorage 将策略从 2 更改为 0,cookie 文件:file:///Users/krishanu_mukherjee/Library/Developer/CoreSimulator/Devices/67065A2C -5E45-47EB-AAD8-5F2E8D5149F4/data/Containers/Data/Application/13D49686-3CB1-4CC3-9967-772BBC693FFA/Library/Cookies/io.ionic.starter.binarycookies 2018-05-21 13:04:04.026035+0530 thegrand[665:8151] Apache Cordova 本机平台版本 4.5.3 正在启动。 2018-05-21 13:04:04.028647+0530 thegrand[665:8151] 多任务 -> 设备:是,应用程序:是 2018-05-21 13:04:04.118347+0530 thegrand[665:8151] CDVWKWebViewEngine: 试图注入 XHR polyfill 2018-05-21 13:04:04.468109+0530 thegrand[665:8151] CDVWKWebViewEngine 将在恢复时重新加载 WKWebView 2018-05-21 13:04:04.468371+0530 thegrand[665:8151] 使用离子 WKWebView 2018-05-21 13:04:04.470572+0530 thegrand[665:8151] [CDVTimer][控制台] 0.168085ms 2018-05-21 13:04:04.470968+0530 thegrand[665:8151] [CDVTimer][handleopenurl] 0.163078ms 2018-05-21 13:04:04.474148+0530 thegrand[665:8151] [CDVTimer][intentandnavigationfilter] 3.002048ms 2018-05-21 13:04:04.474516+0530 thegrand[665:8151] [CDVTimer][gesturehandler] 0.118971ms 2018-05-21 13:04:04.474793+0530 thegrand[665:8151] [CDVTimer][paypalmobile] 0.108004ms 2018-05-21 13:04:04.475352+0530 thegrand[665:8151] CDVIonicKeyboard:调整大小模式 1 2018-05-21 13:04:04.476834+0530 thegrand[665:8151] [CDVTimer][键盘] 1.547933ms 2018-05-21 13:04:04.533597+0530 thegrand[665:8151] [CDVTimer][闪屏] 56.516051ms 2018-05-21 13:04:04.533796+0530 thegrand[665:8151] [CDVTimer][TotalPluginStartup] 63.489914ms 2018-05-21 13:04:12.591638+0530 thegrand[665:8151] Angular 正在开发模式下运行。调用 enableProdMode() 以启用生产模式。 2018-05-21 13:04:12.592087+0530 thegrand[665:8151] deviceready 5 秒后未触发。 2018-05-21 13:04:12.592766+0530 thegrand[665:8151] 频道未触发:onDOMContentLoaded 2018-05-21 13:04:12.593073+0530 thegrand[665:8151] Ionic Native:设备就绪事件在 4048 毫秒后触发 2018-05-21 13:04:12.896733+0530 thegrand[665:8151] 警告:本机:尝试调用 StatusBar.styleDefault,但未安装 StatusBar 插件。 2018-05-21 13:04:12.897143+0530 thegrand[665:8151] 警告:安装状态栏插件:'ionic cordova plugin add cordova-plugin-statusbar' 2018-05-21 13:04:13.135458+0530 thegrand[665:8151] CDVWKWebViewEngine:handleStopScroll 2018-05-21 13:04:13.172548+0530 thegrand[665:8151] 警告:谷歌地图 API 警告:NoApiKeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys 2018-05-21 13:04:13.407415+0530 thegrand[665:8151] 错误:Google Maps API 错误:MissingKeyMapError https://developers.google.com/maps/documentation/javascript/error-messages#missing-key-map-error 2018-05-21 13:04:20.262243+0530 thegrand[665:8151] CDVWKWebViewEngine:handleStopScroll 2018-05-21 13:04:23.648832+0530 thegrand[665:8151] CDVWKWebViewEngine:handleStopScroll 2018-05-21 13:04:27.249545+0530 thegrand[665:8151] CDVWKWebViewEngine:handleStopScroll 2018-05-21 13:04:30.888592+0530 thegrand[665:8151] CDVWKWebViewEngine:handleStopScroll 2018-05-21 13:04:32.490485+0530 盛大[665:8151] 1 0 2018-05-21 13:04:32.856165+0530 thegrand[665:8923] 在主线程以外的线程上执行的调度队列上创建了位置管理器 (0x7fbb58f11990)。开发人员有责任确保在分配位置管理器对象的线程上运行运行循环。特别是,不支持在任意调度队列(未附加到主队列)中创建位置管理器,这将导致无法接收回调。 2018-05-21 13:04:32.971875+0530 thegrand[665:8924]-[NSCFNumber 长度]:无法识别的选择器发送到实例 0xb0000000000000c5 2018-05-21 13:04:32.978500+0530 thegrand [665:8924] *** 由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“-[__NSCFNumber 长度]:无法识别的选择器发送到实例 0xb0000000000000c5” *** 首先抛出调用堆栈: ( 0 核心基础 0x0000000108eb71e6 __exceptionPreprocess + 294 1 libobjc.A.dylib 0x000000010851e031 objc_exception_throw + 48 2核心基础0x0000000108f38784-[NSObject(NSObject)不识别选择器:]+132 3 核心基础 0x0000000108e39898 ___forwarding_ + 1432 4 核心基础 0x0000000108e39278 _CF_forwarding_prep_0 + 120 5 基础 0x00000001042cba3c -[NSScanner(NSDecimalNumberScanning) scanDecimal:] + 303 6 基础 0x0000000104355f41 -[NSDecimalNumberPlaceholder initWithString:locale:] + 127 7 基础 0x00000001043561de +[NSDecimalNumber decimalNumberWithString:] + 46 8 thegrand 0x0000000102fb0535 __51-[PayPalMobileCordovaPlugin renderSinglePaymentUI:]_block_invoke + 1013 9 libdispatch.dylib 0x000000010a721807 _dispatch_call_block_and_release + 12 10 libdispatch.dylib 0x000000010a722848 _dispatch_client_callout + 8 11 libdispatch.dylib 0x000000010a727675 _dispatch_queue_override_invoke + 1451 12 libdispatch.dylib 0x000000010a72e3c8 _dispatch_root_queue_drain + 664 13 libdispatch.dylib 0x000000010a72e0d2 _dispatch_worker_thread3 + 132 14 libsystem_pthread.dylib 0x000000010ac4c1ca _pthread_wqthread + 1387 15 libsystem_pthread.dylib 0x000000010ac4bc4d start_wqthread + 13 ) libc++abi.dylib:以 NSException 类型的未捕获异常终止
【问题讨论】:
请完善您的问题。 【参考方案1】:我猜你正在使用 ionic native paypal 插件,你会发现这条线
this.payPal.prepareToRender('PayPalEnvironmentSandbox', new PayPalConfiguration(
// Only needed if you get an "Internal Service Error" after PayPal login!
//payPalShippingAddressOption: 2 // PayPalShippingAddressOptionPayPal
)).then(() =>
let payment = new PayPalPayment('3.33', 'USD', 'Description', 'sale');
this.payPal.renderSinglePaymentUI(payment).then(() =>
价格将是整数,例如 -> 3.33 而不是字符串 '3.33' 在android的情况下它可以正常工作,但在ios上它会使应用程序崩溃
【讨论】:
谢谢,它成功了。只是我必须将值转换为字符串,然后应用程序停止崩溃以上是关于单击贝宝时,Ionic 3 IOS 应用程序崩溃的主要内容,如果未能解决你的问题,请参考以下文章
iOS 9 Ionic Cordova 应用程序在 iPhone 上崩溃;在 iPad 上工作