Nativescript-cli: Can't run ios app on case-sensitive filesystem on macOS

Created on 4 Jul 2017  Β·  10Comments  Β·  Source: NativeScript/nativescript-cli

_From @NickIliev on July 3, 2017 14:31_

_From @gbonline on June 30, 2017 13:30_

Hi, I tried to update nativescript this morning, to the 3.1.1 version, and my angular app didn't run anymore, also a new project don't work with the error of missing entitlements file

I tried with the simply commands

tns create new2 --ng
cd new2
tns run ios

then It can't run with a trace like this:

Create product structure
/bin/mkdir -p /Users/nemesix/Sviluppo/NativeScript3/new2/platforms/ios/build/emulator/new2.app

ProcessProductPackaging "" build/new2.build/Debug-iphonesimulator/new2.build/new2.app.xcent
    cd /Users/nemesix/Sviluppo/NativeScript3/new2/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/lib/share/oracle/instantclient_12_1"
    builtin-productPackagingUtility -entitlements -format xml -o /Users/nemesix/Sviluppo/NativeScript3/new2/platforms/ios/build/new2.build/Debug-iphonesimulator/new2.build/new2.app.xcent
warning: Falling back to contents of entitlements file "new2.entitlements" because it was modified during the build process. Modifying the entitlements file during the build is unsupported.error: The file β€œnew2.entitlements” couldn’t be opened because there is no such file.

** BUILD FAILED **


The following build commands failed:
    ProcessProductPackaging "" build/new2.build/Debug-iphonesimulator/new2.build/new2.app.xcent
(1 failure)
Unable to apply changes on device: D7FEB5F0-06BB-4EF8-B9E8-61ED4FAEA138. Error is: Command xcodebuild failed with exit code 65.

What can I do?

_Copied from original issue: NativeScript/NativeScript#4484_

_Copied from original issue: NativeScript/ios-runtime#776_

bug ios

Most helpful comment

I think the following line is the root cause: https://github.com/NativeScript/nativescript-cli/blob/master/lib/services/ios-entitlements-service.ts#L25 where this.$devicePlatformsConstants.iOS resolves to iOS while it should be ios

All 10 comments

_From @yavin5 on July 3, 2017 14:37_

I have this problem now as well, and I don't know how to fix it.

_From @yavin5 on July 3, 2017 17:8_

Why is this issue closed without any solution?

_From @NickIliev on July 4, 2017 7:20_

@yavin5 the issue was never closed but moved to this repository - however, we can not reproduce the issue on our side so any additional information available would be of great help.
DO you have all the prerequisites for working with nativeScript on your MAC (XCode, xcodeproj, CocoaPods y as listed here)

@gbonline @yavin5 I can't reproduce the issue. I tried with the following steps:

tns create new2 --ng
cd new2
tns run ios

Can you think of something that may help reproducing the issue e.g. using the latest beta of Xcode or some other tool.
I found similar issue in the Firebase plugin repo -> https://github.com/EddyVerbruggen/nativescript-plugin-firebase/issues/333 but it seems that it is not the same because it requires using the Firebase plugin.

I guess that the CLI build step cleans the new2.entitlements file and the build fails later because it can't find it. I assume that it is related to this one https://github.com/NativeScript/nativescript-cli/pull/2753 so I am moving the issue to the nativescript-cli repo.

I have also the same error. With version 3.0.x is was ok. The dependencies I use are:

"dependencies": {
    "@angular/animations": "~4.1.0",
    "@angular/common": "~4.1.0",
    "@angular/compiler": "~4.1.0",
    "@angular/core": "~4.1.0",
    "@angular/forms": "~4.1.0",
    "@angular/http": "~4.1.0",
    "@angular/platform-browser": "~4.1.0",
    "@angular/router": "~4.1.0",
    "base-64": "^0.1.0",
    "nativescript-advanced-webview": "^1.1.3",
    "nativescript-angular": "~3.0.0",
    "nativescript-pdf-view": "^2.0.1",
    "nativescript-push-notifications": "^0.1.3",
    "nativescript-telerik-ui": "^2.0.1",
    "nativescript-theme-core": "~1.0.2",
    "reflect-metadata": "~0.1.8",
    "rxjs": "~5.3.0",
    "tns-core-modules": "^3.1.0",
    "utf8": "^2.1.2",
    "zone.js": "~0.8.2"
  }

On a case sensitive file system it does not work. The project is built into a platforms/iosfolder. The entitlement file is copied to a platforms/iOSfolder.

screen shot 2017-07-18 at 10 43 07

A case for reproduction:

Apple Swift version 3.1 (swiftlang-802.0.53 clang-802.0.42)
node: v6.9.1
cocoapods: /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.0/lib/cocoapods.rb
tns info:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Component        β”‚ Current version β”‚ Latest version β”‚ Information β”‚
β”‚ nativescript     β”‚ 3.1.2           β”‚ 3.1.2          β”‚ Up to date  β”‚
β”‚ tns-core-modules β”‚ 3.1.0           β”‚ 3.1.0          β”‚ Up to date  β”‚
β”‚ tns-android      β”‚ 3.1.1           β”‚ 3.1.1          β”‚ Up to date  β”‚
β”‚ tns-ios          β”‚ 3.1.0           β”‚ 3.1.0          β”‚ Up to date  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

I create a new project:

$ tns create iostest
Installing  tns-template-hello-world
/somewhere/iostest
└─┬ [email protected]
  └── [email protected]

Installing  tns-core-modules
/somewhere/iostest
└─┬ [email protected]
  └── [email protected]

Project iostest was successfully created.

then

$ cd iostest

and

$ tns run ios
Searching for devices...
Copying template files...
  β—œ Installing tns-iosInstalling  tns-ios
/somewhere/iostest
└── [email protected]

Project successfully created.
Preparing project...
Successfully prepared plugin nativescript-theme-core for ios.
Successfully prepared plugin tns-core-modules for ios.
Successfully prepared plugin tns-core-modules-widgets for ios.
Project successfully prepared (iOS)
Building project...

...

warning: Falling back to contents of entitlements file "iostest.entitlements" because it was modified during the build process. Modifying the entitlements file during the build is unsupported.error: The file β€œiostest.entitlements” couldn’t be opened because there is no such file.

** BUILD FAILED **


The following build commands failed:
    ProcessProductPackaging "" build/iostest.build/Debug-iphonesimulator/iostest.build/iostest.app.xcent
(1 failure)
Unable to apply changes on device: A176F414-7050-4742-8B35-1B2DDAB865FE. Error is: Command xcodebuild failed with exit code 65.

so the problem is still there.

I tried the workaround described in this issue, so I created the file iostest.entitlements in App/App_Resources/iOS and pasted the content as described.

I removed the ios platform, recreated it, and run the app in the emulator again.

The error is still the same.

In the platforms directory, I can see:
28413773-7895d5a6-6d51-11e7-965b-2e79a5d68b16

So, something is working the wrong way.

In another project, before the upgrade to 3.1.2, the workaround worked fine...

I think the following line is the root cause: https://github.com/NativeScript/nativescript-cli/blob/master/lib/services/ios-entitlements-service.ts#L25 where this.$devicePlatformsConstants.iOS resolves to iOS while it should be ios

I can confirm that the problem occurs on case sensitive file systems

Hey all,
Thanks for the information and special thanks to @spike1292 who had found the root cause of the issue. We've already fixed it in master branch, so you can give it a try by installing CLI's next version: npm i -g nativescript@next

Was this page helpful?
0 / 5 - 0 ratings

Related issues

farfromrefug picture farfromrefug  Β·  3Comments

donker picture donker  Β·  3Comments

bradmartin picture bradmartin  Β·  3Comments

NickIliev picture NickIliev  Β·  3Comments

ZMW9 picture ZMW9  Β·  3Comments