Ionic 3 - 添加或构建iOS应用程序时出错

时间:2018-03-27 07:04:11

标签: javascript ios angular cordova ionic3

在使用ionic cordova build iosionic cordova platform add ios构建或添加ios时出现以下错误。该版本适用于Android。

IOS project now has deployment target set as: 8.0
IOS project Code Sign Entitlements now set to: App/Resources/App.entitlements
Entitlements file is not in references section, adding it
{ Error: ENOENT: no such file or directory, open '/Users/cipriancirstea/Documents/ionic_app/ul_web_hooks/ios/https:/t4edc.app.goo.gl/#apple-app-site-association'
    at Object.fs.openSync (fs.js:667:18)
    at Object.fs.writeFileSync (fs.js:1326:33)
    at saveContentToFile (/Users/cipriancirstea/Documents/ionic_app/plugins/cordova-universal-links-plugin/hooks/lib/ios/appleAppSiteAssociationFile.js:118:8)
    at /Users/cipriancirstea/Documents/ionic_app/plugins/cordova-universal-links-plugin/hooks/lib/ios/appleAppSiteAssociationFile.js:72:5
    at Array.forEach (<anonymous>)
    at createNewAssociationFiles (/Users/cipriancirstea/Documents/ionic_app/plugins/cordova-universal-links-plugin/hooks/lib/ios/appleAppSiteAssociationFile.js:70:27)
    at Object.generate (/Users/cipriancirstea/Documents/ionic_app/plugins/cordova-universal-links-plugin/hooks/lib/ios/appleAppSiteAssociationFile.js:45:3)
    at activateUniversalLinksInIos (/Users/cipriancirstea/Documents/ionic_app/plugins/cordova-universal-links-plugin/hooks/afterPrepareHook.js:85:29)
    at /Users/cipriancirstea/Documents/ionic_app/plugins/cordova-universal-links-plugin/hooks/afterPrepareHook.js:50:11
    at Array.forEach (<anonymous>)
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/cipriancirstea/Documents/ionic_app/ul_web_hooks/ios/https:/t4edc.app.goo.gl/#apple-app-site-association' }

config.xml中

<universal-links>
    <host name="https://t4edc.app.goo.gl/" scheme="https" />
    <host name="example-902cc.firebaseapp.com" scheme="https">
        <path url="/__/auth/callback" />
    </host>
</universal-links>

2 个答案:

答案 0 :(得分:0)

根据输出,您似乎正在尝试在Windows操作系统上构建。

不幸的是,你需要一个带有Xcode的苹果或Mac操作系统,以便为IOS设备进行正确的构建。

For Reference

答案 1 :(得分:0)

发生此错误是因为您将https://放在主机name之前。

要摆脱该错误,只需替换为:

<host name="https://t4edc.app.goo.gl/" scheme="https" />

与此:

<host name="t4edc.app.goo.gl/" scheme="https" />

该错误背后的原因是,该插件会自动在ul_web_hooks/ios/下创建文件,并且这些文件均由相应的主机名命名。在MacO(通常在* nix平台上)上,不允许冒号(:)成为文件路径的一部分。

希望有帮助!祝你好运!