Cordova iOS构建失败,带有"edit-config"标签 [英] Cordova iOS build fails with 'edit-config' tag
问题描述
我有一个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中包含以下内容:
I have an Ionic 3 app (Ionic CLI 3.19.0, Cordova CLI 8.0.0, android platform 7.0.0,
ios platform 4.5.4) that includes the native 'Geolocation' plugin. Since iOS 10+ requires the NSLocationWhenInUseUsageDescription
property in the App-Info.plist file, the plugin's documentation (Geolocation iOS Quirks) says to include the following in the 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>
标记内的第一个条目.
So I added that verbatim as the first entry within <platform name="ios">...</platform>
tag of my config.xml.
在构建的cordova iOS阶段,它失败并出现以下晦涩的错误:
During the cordova iOS stage of the build, it fails with the following obscure errors:
(node:60604)UnhandledPromiseRejectionWarning:未处理的承诺拒绝(拒绝ID:1):TypeError:doc.find不是函数
(node:60604)UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: doc.find is not a function
(节点:60604)[DEP0018] DeprecationWarning:已弃用未处理的承诺拒绝.将来,未处理的承诺拒绝将以非零退出代码终止Node.js进程.
(node:60604) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
推荐答案
如上面的注释中所述,所需步骤为:
As mentioned in the comment above, the steps needed are:
- 删除平台ios: cordova平台删除ios
-
将编辑配置添加到平台名称="ios" 标记
- Remove platforms ios: cordova platform remove ios
Add the edit-config into platform name="ios" tag
<platform name="ios"> Add me here </platform>
运行准备ios:离子科尔多瓦准备ios
这篇关于Cordova iOS构建失败,带有"edit-config"标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!