nativescript-cli: EACCES (Permission denied) when livesync Angular projects on Samsung devices

From @S4M37 on February 3, 2017 14:27

I’m using NativeScript 2.5.0 with Angular2, using android platform with building tool 25.0.2, I’m testing on a device, and tns doctor no issues are found. So my problem is when running ‘tns run android’ the app is launched but no changes are applied, here is the log

Project successfully prepared (android) Transferring project files… Unable to sync files. Error is: ENOENT: no such file or directory, stat ‘C:\Users\S4M37\Desktop\CrossPlatform\project\platforms\android\src\main\assets\app\modules\feed\item\feed.item.css___jb_tm p___’ 02-03 15:16:18.512 5693 5693 W System.err: remove failed: EACCES (Permission denied) : /data/local/tmp/org.nativescript.project/sync/tns_modules/rxjs/src/MiscJSDoc.ts 02-03 15:16:18.532 5335 5335 E audit : type=1400 msg=audit(1486131378.512:526786): avc: denied { unlink } for pid=5693 comm=“tivescript.project” name=“MiscJSDoc.ts” dev=“dm-1” ino=335142 s context=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:shell_data_file:s0 tclass=file permissive=0 02-03 15:16:18.562 5693 5693 W System.err: remove failed: EACCES (Permission denied) : /data/local/tmp/org.nativescript.project/sync/tns_modules/rxjs/src/observable/dom/MiscJSDoc.ts 02-03 15:16:18.582 5335 5335 E audit : type=1400 msg=audit(1486131378.562:526982): avc: denied { unlink } for pid=5693 comm=“tivescript.project” name=“MiscJSDoc.ts” dev=“dm-1” ino=335340 s context=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:shell_data_file:s0 tclass=file permissive=0 JS: Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode. 02-03 15:16:22.322 5693 5693 W ExifInterface: at com.tns.Runtime.callJSMethodNative(Native Method)

Copied from original issue: NativeScript/NativeScript#3569

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 28 (11 by maintainers)

Most upvoted comments

I’m testing on Samsung Galaxy S7, android 6.0.1 I run tns run android, it builds the app, installs it on device then after each changes the app is refreshed but without synchronizing files with the same error mentioned in the issue, to synchronize files I stop the processes and re-run tns run android.

The new LiveSync with sockets, that will be used in CLI 4.2.0 will resolve this issue. In order to give it a try, you need both latest CLI and latest android runtime.

Hi there , am already signed up on Github and I tried to run those commands on the Github Command Line Interface ,but not able to know how to install the nativescript cli. Regards, Palak Grover

On Sat, Feb 18, 2017 at 2:18 PM, Angel Tsvetkov notifications@github.com wrote:

Hi Guys, In regards of the second error I think I figured out why this happens. In my AndroidManifest.xml file in my NativeScript project the android:minSdkVersion=“17”. There is a user permission for write external storage:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_ STORAGE"/>

According to Android documentation WRITE_EXTERNAL_STORAGE starting in API level 19 is not required to read/write files in your application-specific directories (documentation https://developer.android.com/reference/android/Manifest.permission.html#WRITE_EXTERNAL_STORAGE). My test device is Samsung Galaxy S5 with Android 6.0.1 (API 23). I think that the issue comes when you request user permission WRITE_EXTERNAL_STORAGE on Android API > 18. The solution I found is to set android:maxSdkVersion=“18” attribute to WRITE_EXTERNAL_STORAGE user-permission (documentation https://developer.android.com/guide/topics/manifest/uses-permission-element.html) so it looks like:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18"/>

Don’t forget to remove platform (tns platform remove android) and then re-run your app.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/NativeScript/nativescript-cli/issues/2485#issuecomment-280832069, or mute the thread https://github.com/notifications/unsubscribe-auth/AYiZ-9Rjcl99s8GWkfqY5xYzMIOcDilNks5rdrBqgaJpZM4L2anI .

Happened again:

Transferring project files...
Unable to sync files. Error is: ENOENT: no such file or directory, stat 'C:\_Projects\_NativeScript\project\platforms\android\src\main\assets\app\tns_modules\sharp\build\Release\obj\libvips-cpp\libvips-cpp.tlog\link-VCTIP.delete.93.tlog'

The folder sharp doesn’t exist. Is sharp a necessary import? Added it now to the dependencies (“sharp”: “^0.16.2”). I will keep you updated if it changes anything.

Can’t reproduce it. Happens from time to time and then I have to restart the app. (tns run android) I’m using the android emulator. Haven’t tried it on a physical device.

Also experiencing this error after updating to 2.5