【问题标题】:Cloud build for iOS using Nativescript Sidekick results in CODE_SIGN_ENTITLEMENTS error使用 Nativescript Sidekick 为 iOS 构建云会导致 CODE_SIGN_ENTITLEMENTS 错误
【发布时间】:2018-11-17 16:59:54
【问题描述】:

将 app.entitlements 文件添加到项目以启用推送通知 (aps-environment) 后,Sidekick 云构建会产生错误 表示云构建服务器找不到app.entitlements文件。

The following build commands failed:
\tCheck dependencies
(1 failure)
Code Signing Error: The file \"/tmp/builds/_/146cf62166c1319ab4a033cc9caf241a3f6550f1/4.2.4/4.2.0/AngusConsumerMobileAppv3/platforms/ios/AngusConsumerMobileAppv3\\app.entitlements\" could not be opened. Verify the value of the CODE_SIGN_ENTITLEMENTS build setting for target \"AngusConsumerMobileAppv3\" and build configuration \"Release\" is correct and that the file exists on disk.

app.entitlements 文件位置在构建期间自动包含在 build.xcconfig 文件中。从 build.xcconfig 文件中删除此行会导致重新添加相同的位置。

build.xcconfig

CODE_SIGN_ENTITLEMENTS = AngusConsumerMobileAppv3\app.entitlements

app.entitlements

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>aps-environment</key>
    <string>production</string>
</dict>
</plist>

环境:

Version: 1.13.0-v.2018.10.5.2 (latest)
NativeScript CLI version: 4.2.4
CLI extension nativescript-cloud version: 1.14.2
CLI extension nativescript-starter-kits version: 0.3.5

【问题讨论】:

    标签: nativescript sidekick


    【解决方案1】:

    看起来这是一个简单的路径问题,我认为它基于使用反斜杠的 Windows 路径约定与使用云服务器上需要的前斜杠的 linux 约定(不确定真正原因,但工作下面似乎修复了它)这会导致构建在由于路径错误而找不到 app.entitlements 文件时失败。

    您似乎还必须声明自己的文件名。允许系统使用默认的 app.entitlements 文件似乎总是导致我在 build.xcconfig 中的手动输入被注释掉并替换为反斜杠路径。

    所以 - 我只是为自定义命名的 myapp.entitlements 文件创建了一个条目

    build.xcconfig

    CODE_SIGN_ENTITLEMENTS = myapp_local_folder/myapp.entitlements
    

    myapp.entitlements

    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>aps-environment</key>
        <string>production</string>
    </dict>
    </plist>
    

    这为生产启用了 PUSH 通知,并且构建和发布到 iOS 应用商店按预期工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-11-03
      • 1970-01-01
      • 1970-01-01
      • 2011-05-14
      • 2018-07-15
      相关资源
      最近更新 更多