Ionic - 构建IOS版本应用程序时出现错误

3

我使用PC和Windows 10开发了整个应用程序。我已经成功构建了Android版本并将其上传到Play商店,已经通过审核。

现在,我面临着准备iOS版本的挑战,我本以为这会很简单。然而,经过多个小时的努力,我仍然遇到同样的问题,不知道如何解决。运行ionic Cordova build ios,我收到以下错误信息:

(node:1852) UnhandledPromiseRejectionWarning: SyntaxError: Expected "/ Begin ", "/ End ", "\"", or [A-Za-z0-9_.] but "/" found. at peg$buildStructuredError (/Users/mitja/Projects/oventura/platforms/ios/cordova/node_modules/xcode/lib/parser/pbxproj.js:412:12) at Object.peg$parse [as parse] (/Users/mitja/Projects/oventura/platforms/ios/cordova/node_modules/xcode/lib/parser/pbxproj.js:1886:11) at pbxProject.parseSync (/Users/mitja/Projects/oventura/platforms/ios/cordova/node_modules/xcode/lib/pbxProject.js:46:24) at Object.parseProjectFile [as parse] (/Users/mitja/Projects/oventura/platforms/ios/cordova/lib/projectFile.js:41:15) at updateFileResources (/Users/mitja/Projects/oventura/platforms/ios/cordova/lib/prepare.js:480:33) at /Users/mitja/Projects/oventura/platforms/ios/cordova/lib/prepare.js:65:13 at _fulfilled (/Users/mitja/Projects/oventura/platforms/ios/cordova/node_modules/q/q.js:854:54) at self.promiseDispatch.done (/Users/mitja/Projects/oventura/platforms/ios/cordova/node_modules/q/q.js:883:30) at Promise.promise.promiseDispatch (/Users/mitja/Projects/oventura/platforms/ios/cordova/node_modules/q/q.js:816:13) at /Users/mitja/Projects/oventura/platforms/ios/cordova/node_modules/q/q.js:570:49 (node:1852) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:1852) [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.

我不知道是哪个文件或我的应用程序的哪个部分导致了错误,但我确实知道在创建一个新项目并构建它时一切都很顺利,因此肯定是我们项目中的某些问题(Windows下为Android构建良好)。

这是我们的插件清单:

"cordova-plugin-statusbar"
"cordova-plugin-whitelist"
"cordova-plugin-device"
"cordova-plugin-splashscreen"
"cordova-plugin-ionic-webview"
"cordova-plugin-ionic-keyboard"
"cordova-plugin-datepicker"
"cordova-plugin-braintree"
"uk.co.workingedge.phonegap.plugin.launchnavigator"
"mx.ferreyra.callnumber"

对于Braintree,根据插件的github仓库所述,我需要执行npm install plist和npm install Xcode命令,所以已经完成了安装。

那么,是什么原因导致了错误?我该尝试什么来成功构建iOS版本呢?

2个回答

1

我忘记更新答案了,但是问题已经找到,是Braintree插件的问题。为了使其正常工作,你必须使用官方插件的分支版本:

ionic cordova platform remove ios
ionic cordova plugin add https://github.com/dpa99c/cordova-plugin-braintree
ionic cordova platform add ios

您是否已经正确删除了插件的官方版本?我曾经遇到过这样的问题。 - MaTTo
是的,我在Android上也遇到了这个问题,我解决了它,方法如下:https://github.com/ionic-team/ionic/issues/13857#issuecomment-366478515 今晚我会尝试类似的方法来解决IOS上的问题。 - Eliut Islas
终于成功了,我使用的是ios@4.5.5版本,我的笔记本电脑默认使用的是4.5.4版本。 - Eliut Islas

0
将Geolocation代码放到

标签里面。

    this.platform.ready().then(() => {
  this.geolocation.getCurrentPosition().then((resp) => {
      console.log(resp.coords.latitude);
      console.log(resp.coords.longitude);

})

已解决的问题与地理定位插件无关。 :) - MaTTo

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接