Reputation: 1724
After adding an app.entitlements file to the project for the purpose of enabling push notification (aps-environment) Sidekick cloud build produces an error indicating that the cloud build server can not locate the app.entitlements file.
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.
The app.entitlements file location is auto-included during the build in the build.xcconfig file. Removing this line from the build.xcconfig file results in the same location being re-added.
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>
The environment:
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
Upvotes: 1
Views: 1136
Reputation: 1724
It looks like this is a simple path issue which I think is based around windows path convention using a back-slash vs the linux convention using a front-slash which is needed on the cloud server (not sure truly why but the work around below seems to fix it) which causes the build to fail when it can not find the app.entitlements file due to a bad path.
It looks like you MUST ALSO declare your own filename. Allowing the system to use the default app.entitlements file seemed to always result in my manual entry in build.xcconfig being commented out and replaced with a back-slashed path.
SO - I simply made an entry for the custom-named myapp.entitlements file
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>
This enabled PUSH notifications for production and the build and publish to the iOS app store worked as expected.
Upvotes: 4