【发布时间】:2018-06-12 09:47:52
【问题描述】:
我有一个 Ionic 3 应用程序(Ionic CLI 3.19.0、Cordova CLI 8.0.0、android 平台 7.0.0、
ios 平台 4.5.4),包括本机“地理定位”插件。由于 iOS 10+ 需要 App-Info.plist 文件中的 NSLocationWhenInUseUsageDescription 属性,因此插件的文档 (Geolocation iOS Quirks) 表示在 config.xml 中包含以下内容:
<edit-config target="NSLocationWhenInUseUsageDescription" file="*-Info.plist" mode="merge">
<string>need location access to find things nearby</string>
</edit-config>
所以我将它逐字添加为我的 config.xml 的 <platform name="ios">...</platform> 标记中的第一个条目。
在构建的 cordova iOS 阶段,它失败并出现以下模糊错误:
(node:60604)UnhandledPromiseRejectionWarning: 未处理的承诺拒绝 (rejection id: 1): TypeError: doc.find is not a function
(node:60604) [DEP0018] DeprecationWarning:不推荐使用未处理的承诺拒绝。将来,未处理的 Promise 拒绝将使用非零退出代码终止 Node.js 进程。
【问题讨论】:
-
我发现删除然后添加 iOS 平台可以解决问题。但是,这会破坏一些使用的插件,因为它们需要先安装平台。因此,我必须重新安装这些插件。
标签: ios cordova ionic-framework cordova-plugins