Nativescript-cli: tns run ios issue with 2.5.0 - unable to sync files on iOS Simulator

Created on 2 Feb 2017  Ā·  21Comments  Ā·  Source: NativeScript/nativescript-cli

Output:

Unable to sync files. Error is: cp: copyFileSync: could not write to dest file (code=ENOENT):/Users/toddanglin/Library/Developer/CoreSimulator/Devices/50DFBA8C-A077-4EB4-B49F-93D2FAE13810/data/Containers/Bundle/Application/6878EDAF-504B-4366-9CE4-B5A97870EA3C/ns-demo.app/Resources/en.lproj/Localizable.strings

Seems to fail with the same error on different files in ā€œ/Resources/en.lprojā€. Here it’s ā€œLocalizable.strings.ā€ Sometimes it’s ā€œInfoPlist.stringsā€.

bug livesync needs more info

All 21 comments

How to reproduce:
Add folder or file to <project_name>/app folder once an application is created with any template.

I got the same problem over here. I'm using the plugin nativescript-i18n and when I make a first change after run tns run ios it refresh the app but with next changes it throws that error and does not reload the app anymore. I'm using tns 2.5.0

+1 I've go the same situation as @JuanDelgadillo. Building on Mac for iOS, targeting the simulator.

tns run ios --emualtor will work the first time and do one LiveSync. After that, it errors-out with the copyFileSync errors. Current workaround is to simply kill the running command and restart tns run.

I'm experiencing the problem while using nativescript-dev-sass. I'm able to run the app using "tns run android", but as soon as I touch a single .scss file NativeScript tries to sync and everything blow ups. Here is the relevant issue in nativescript-dev-sass bugtracker: https://github.com/toddanglin/nativescript-dev-sass/issues/18

I still get this in tns --version 2.5.4. The first time is fine, but on 2nd run, my assets directory fails every time since I added images to it.

[1] Transferring project files...
[1] Unable to sync files. Error is: EEXIST: file already exists, mkdir '... /assets '

I still get this aswell.

Hey, @vance @lukeramsden,
We've released 2.5.5 and 3.0.1 with another fix that references this problem. Would you like to give it a try and write back with the results. Meanwhile I'll reopen the issue.

@vance @lukeramsden Can you reproduce the problem with hello-world app?

I believe it is an issue caused by nativescript-dev-sass, nativescript-i18n or some other plugin.
If the issue is caused by some 3rd party plugin we should log it in plugin's repo.

@dtopuzov I will try tomorrow, and I use both of those plugins :P

FWIW, the nativescript-dev-sass plugin _should_ be updated and working as expected in NativeScript 2.5.x and 3.x. Let me know if you encounter an issue and we'll try to troubleshoot.

@lukeramsden pelase also post versions of nativescript-dev-sass and nativescript-i18n plugings in your proejct, it might hapen that it is plugin problem that is fixed in newer versions of the plugin.

@lukeramsden Any update on this?

@dtopuzov Sorry I didn't get a chance to test it, been very busy releasing the app.

I'm getting a similar problem with the latest version of nativescript 3.0.1 - Very basic setup on Ubuntu 16.04 although my colleagues who work in a windows environment tell my live-sync is OK for them - error as follows when edit a basic ts file from the Hello world app and save:

Executing before-prepare hook from /home/simon/projects/nativescript/HelloWorld/hooks/before-prepare/nativescript-dev-android-snapshot.js
Executing before-prepare hook from /home/simon/projects/nativescript/HelloWorld/hooks/before-prepare/nativescript-dev-typescript.js
Preparing project...
Project successfully prepared (android)
Executing after-prepare hook from /home/simon/projects/nativescript/HelloWorld/hooks/after-prepare/nativescript-dev-android-snapshot.js
Transferring project files...
Unable to sync files. Error is: Multiple errors were thrown:
ENOENT: no such file or directory, stat '/home/simon/projects/nativescript/HelloWorld/platforms/android/src/main/assets/app/app.component.ts___jb_tmp___'

OK - found the answer to the above problem - Intellij saves temp files as a "safe write" option which was causing the issue. So if turn off evrything is OK. System Settings => "Use safe write" in intellij

Hi @shakes90

It looks you are hitting https://github.com/NativeScript/nativescript-cli/issues/2720 which is already fix in master branch.

If you want to try it:

npm un -g nativescript 
npm cache clean
npm i -g nativescript@next

@shakes90 is right

On linux I didn't have this issue on NS 2.5, and I have it now on 3.0

Hi @Nikoms,

The issue @shakes90 is different from the original issue in this thread.
It is already fixed in code base, available in @next builds and will be released in 3.1.0.

How to test with @next builds:

npm un -g nativescript
npm cache clean
npm i -g nativescript@next

Closing this issue since tns run ios works property in general.

Reported issues are either problem with specific plugin (should be addressed by plugin itself) or not related with the original issue (the problem with temp files on linux).

No. This problem returned on TNS 4. ( already reported here https://github.com/NativeScript/nativescript-cli/issues/3630)

Look at this screen where my app is On :

image

Now let's change something in the code

image

See error :

image

It didn't happen before in v 3
Files are read only due to TFS. But it did work before v4.

complete package.json :

https://gist.github.com/RoyiNamir/c7adb7454b075369b0d325b88575f374

Hi @RoyiNamir

Thanks for logging it at separate issue, we will investigate and post updates there.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DimitarTachev picture DimitarTachev  Ā·  3Comments

NickIliev picture NickIliev  Ā·  3Comments

ZMW9 picture ZMW9  Ā·  3Comments

NickIliev picture NickIliev  Ā·  3Comments

kefahB picture kefahB  Ā·  3Comments