使用 Nativescript Sidekick 的 iOS 云构建导致 CODE_SIGN_ENTITLEMENTS 错误
Cloud build for iOS using Nativescript Sidekick results in CODE_SIGN_ENTITLEMENTS error
为了启用推送通知(aps-environment)向项目添加app.entitlements文件后,Sidekick cloud build产生错误
提示云构建服务器找不到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
看起来这是一个简单的路径问题,我认为它基于使用反斜杠的 windows 路径约定与使用前斜杠的 linux 约定,后者需要云服务器(不确定真正的原因,但下面的解决方法似乎可以修复它)导致构建失败,因为路径错误导致找不到 app.entitlements 文件。
看来您还必须声明自己的文件名。允许系统使用默认 app.entitlements 文件似乎总是导致我在 build.xcconfig 中的手动输入被注释掉并替换为反斜杠路径。
SO - 我只是为自定义命名的 myapp.entitlements 文件
创建了一个条目
build.xcconfig
CODE_SIGN_ENTITLEMENTS = myapp_local_folder/myapp.entitlements
我的app.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>
这为生产启用了推送通知,构建和发布到 iOS 应用程序商店按预期工作。
为了启用推送通知(aps-environment)向项目添加app.entitlements文件后,Sidekick cloud build产生错误 提示云构建服务器找不到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
看起来这是一个简单的路径问题,我认为它基于使用反斜杠的 windows 路径约定与使用前斜杠的 linux 约定,后者需要云服务器(不确定真正的原因,但下面的解决方法似乎可以修复它)导致构建失败,因为路径错误导致找不到 app.entitlements 文件。
看来您还必须声明自己的文件名。允许系统使用默认 app.entitlements 文件似乎总是导致我在 build.xcconfig 中的手动输入被注释掉并替换为反斜杠路径。
SO - 我只是为自定义命名的 myapp.entitlements 文件
创建了一个条目build.xcconfig
CODE_SIGN_ENTITLEMENTS = myapp_local_folder/myapp.entitlements
我的app.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>
这为生产启用了推送通知,构建和发布到 iOS 应用程序商店按预期工作。