NS 2.5 Unable to sync files


#1

Recently after upgrading to 2.5 I keep getting issues with syncing files when running to the project to test on a IOS emulator.

Seems that the build process is not playing well with the SCSS plugin, as a lot of the errors are related to the platform specific scss files.

Unable to sync files. Error is: ENOENT: no such file or directory, stat '/Users/…/app/pages/login/login.scss’
That is the file login.ios.scss for example.

Same is ocurring sometimes with Info.plist.

Unable to sync files. Error is: ENOENT: no such file or directory, stat ‘/Users/…/Resources/Info.plist’

I think there is probably a timing issue while the resources are generated and then published to the phone.
Probably the CLI tries to publish them before or while being generated.


#2

It is a known issue with the 2.5 release, and one that has been addressed in the master branch (@next).

You could fetch the updated CLI by installing the latest package from the master branch npm i nativescript -g. Otherwise if that’s not a blocking issue, you could wait until the next public release of the CLI.


#3

Hello Pete,

Thanks for you response.

I apologize for asking this, as it is not an exact nativescript issue, but how do I install the latest CLI from master.
Using the command you indicate npm i nativescript -g installs the same 2.5.0 version.
I tried installing the package directly indicating the github branch but the command failed, so maybe im missing something.

Can you point me at what command do you use to achieve this?

Thanks.


#4

Hello Pete,

I installed the latest one with npm i nativescript@next -g
But I continue to get the same errors.

Now, what I do notice is that seems that this version automatically restarts itself, so it provides the idea of a more continuous development mode, but the errors continue to be there at least in my console.

This version stated @3.0.0-2017-02-09-7977

The errors continue to popup as:

Unable to sync files. Error is: Multiple errors were thrown:
ENOENT: no such file or directory, stat '/Users/.../app/pages/login/login-common.css'

#5

Apologies for the confusion I caused earlier, the fixes were only present in release at that point, since we are preparing for a hotfixes patch. You can wait for the 2.5.1 release coming later this week or if you are impatient install nativescript@next.

As far as I can tell changes were synced about 4 hours ago from the time of posting, so you should be set now.


#6

Hello Pete,

Just updated to the latest version 2 min ago.
My environment:

CLI version: 3.0.0-2017-02-13-7989
Mac OSX
Node v6.9.4 (installed via nvm)

But when running the build for ios I keep getting similar issues.

Transferring project files...
Unable to sync files. Error is: Multiple errors were thrown:
ENOENT: no such file or directory, stat '/Users/.../Resources/Info.plist'

Project using nativescript-sass, nativescript-i18n.

Thanks.


#7

Please run a project with --log trace, make the crash occur and post the log here so we can have a look. The error seems to be originating from the fact that a path hasn’t been resolved properly, as opposed to those originally occurring.

Thanks!


#8

Here is the output.

I noticed something, the path that it is complaining really does not exists.
The info.plist file does exist at: /Users/…/app/App_Resources/iOS/Info.plist but does not exists at: /Users/…/platforms/ios/myproject/Resources.

I have the log when it failed, complete, planned to upload it, but the platform wont allow me.
Let me know if I you want the file and I can send it to you via another way.

Here I attach what I consider the critical piece.

Skipping prepare.
Will execute livesync for files:  [ '/Users/myosuser/Development/js-project/myproject-app/platforms/ios/myprojectapp/app/app.css',
...
The following files will not be synced as they do not exist: [ '/Users/myosuser/Development/js-project/myproject-app/platforms/ios/myprojectapp/Resources/Info.plist' ]
Transferring project files...
Transferring from /Users/myosuser/Development/js-project/myproject-app/platforms/ios/myprojectapp/app/app.css to /Users/myosuser/Library/Developer/CoreSimulator/Devices/54F1E6C7-625F-4C90-B68F-643247866973/data/Containers/Bundle/Application/37D75E05-0899-4791-B64C-377C9554704F/myprojectapp.app/app/app.css
...
Transferring from /Users/myosuser/Development/js-project/myproject-app/platforms/ios/myprojectapp/Resources/Info.plist to /Users/myosuser/Library/Developer/CoreSimulator/Devices/54F1E6C7-625F-4C90-B68F-643247866973/data/Containers/Bundle/Application/37D75E05-0899-4791-B64C-377C9554704F/myprojectapp.app/Resources/Info.plist
Transferring from /Users/myosuser/Development/js-project/myproject-app/platforms/ios/myprojectapp/Resources/en.lproj/InfoPlist.strings to /Users/myosuser/Library/Developer/CoreSimulator/Devices/54F1E6C7-625F-4C90-B68F-643247866973/data/Containers/Bundle/Application/37D75E05-0899-4791-B64C-377C9554704F/myprojectapp.app/Resources/en.lproj/InfoPlist.strings
Transferring from /Users/myosuser/Development/js-project/myproject-app/platforms/ios/myprojectapp/Resources/en.lproj/Localizable.strings to /Users/myosuser/Library/Developer/CoreSimulator/Devices/54F1E6C7-625F-4C90-B68F-643247866973/data/Containers/Bundle/Application/37D75E05-0899-4791-B64C-377C9554704F/myprojectapp.app/Resources/en.lproj/Localizable.strings
Transferring from /Users/myosuser/Development/js-project/myproject-app/platforms/ios/myprojectapp/Resources/es.lproj/InfoPlist.strings to /Users/myosuser/Library/Developer/CoreSimulator/Devices/54F1E6C7-625F-4C90-B68F-643247866973/data/Containers/Bundle/Application/37D75E05-0899-4791-B64C-377C9554704F/myprojectapp.app/Resources/es.lproj/InfoPlist.strings
Transferring from /Users/myosuser/Development/js-project/myproject-app/platforms/ios/myprojectapp/Resources/es.lproj/Localizable.strings to /Users/myosuser/Library/Developer/CoreSimulator/Devices/54F1E6C7-625F-4C90-B68F-643247866973/data/Containers/Bundle/Application/37D75E05-0899-4791-B64C-377C9554704F/myprojectapp.app/Resources/es.lproj/Localizable.strings
...
Unable to sync files. Error is: Multiple errors were thrown:
ENOENT: no such file or directory, stat '/Users/myosuser/Development/js-project/myproject-app/platforms/ios/myprojectapp/Resources/Info.plist'
objc[62629]: Class PLBuildVersion is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x125be5998) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x125a07880). One of the two will be used. Which one is undefined.

#9

Some other findings.
After realizing the info.plist at folder /Users/…/platforms/ios/myproject/Resources did not existed, I manually created it.

Then I start getting the following issue.

Unable to sync files. Error is: Multiple errors were thrown:
cp: copyFileSync: could not write to dest file (code=ENOENT):/Users/myosuser/Library/Developer/CoreSimulator/Devices/54F1E6C7-625F-4C90-B68F-643247866973/data/Containers/Bundle/Application/37D75E05-0899-4791-B64C-377C9554704F/myproject.app/Resources/Info.plist

Then I realized the folder myproject.app/Resources inside the simulator was missing.
And so I proceeded and created this folder.
Then I started getting the following.

Unable to sync files. Error is: Multiple errors were thrown:
cp: copyFileSync: could not write to dest file (code=ENOENT):/Users/myosuser/Library/Developer/CoreSimulator/Devices/54F1E6C7-625F-4C90-B68F-643247866973/data/Containers/Bundle/Application/37D75E05-0899-4791-B64C-377C9554704F/workrideapp.app/Resources/en.lproj/InfoPlist.strings

This is related to complaining for the folders inside Resources not existing inside the simulator.
Then I proceeded and created these folders manually, in particular en.lproj, es.lproj and Assets.xcassets.
After doing that I stopped getting errors on console, but the app wont start
Trace is:

Executing before-watch hook from /Users/myosuser/Development/js-project/myproject-app/hooks/before-watch/nativescript-dev-typescript.js
Found peer TypeScript 2.0.10
objc[63722]: Class PLBuildVersion is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x11c835998) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x11c657880). One of the two will be used. Which one is undefined.
9:53:15 PM - Compilation complete. Watching for file changes.

Feb 13 21:53:15 Mycomputer-MacBook-Pro com.apple.CoreSimulator.SimDevice.54F1E6C7-625F-4C90-B68F-643247866973.launchd_sim[58784] (UIKitApplication:co.myproject.app[0x9a18][63722]): Service exited due to Trace/BPT trap: 5

Hope this additional information helps diagnosing the issue.


#10

when i replaces images in my drawable folder with different files of same name I then uninstall the app on my device and run tns run android still doesnt sync the new images i added


#11

Run tns build instead, the apk will be the same most likely.


NS 2.5.1 IOS - Incremental build generates inconsistent binary
#12

i run a build but still…still trying it out will let you how it ends.