nativescript-cli icon indicating copy to clipboard operation
nativescript-cli copied to clipboard

EACCES (Permission denied) when livesync Angular projects on Samsung devices

Open NickIliev opened this issue 9 years ago • 28 comments

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

NickIliev avatar Feb 03 '17 14:02 NickIliev

Hey all, would you try our 3.0 RC (nativescript@rc) release and check if you still experience these problems and if so write back with specific steps to reproduce. @jwuliger @dxshindeo @smarza @AbbeYassine @danieljohngomez @RaphaelJenni

pkoleva avatar Mar 30 '17 07:03 pkoleva

I was getting this error so I installed the 3.0 RC on Windows 10. I then created a new project using the tns create MyApp --template tns-template-hello-world-ng@rc command. Still got the same error with tns run android on my Galaxy S6. Doesn't seem to stop the app from running. Only does this on my phone, the emulator is fine.

03-30 21:48:36.604 26548 26548 W System.err: remove failed: EACCES (Permission denied) : /data/local/tmp/org.nativescript.Wisps/sync/tns_modules/rxjs/src/MiscJSDoc.ts
03-30 21:48:36.624  6857  6857 E audit   : type=1400 msg=audit(1490932116.604:46392): avc:  denied  { unlink } for  pid=26548 comm="ivescript.Wisps" name="MiscJSDoc.ts" dev="sda21" ino=337123 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:shell_data_file:s0 tclass=file permissive=0
03-30 21:48:36.664 26548 26548 W System.err: remove failed: EACCES (Permission denied) : /data/local/tmp/org.nativescript.Wisps/sync/tns_modules/rxjs/src/observable/dom/MiscJSDoc.ts
03-30 21:48:36.674  6857  6857 E audit   : type=1400 msg=audit(1490932116.664:46585): avc:  denied  { unlink } for  pid=26548 comm="ivescript.Wisps" name="MiscJSDoc.ts" dev="sda21" ino=337312 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:shell_data_file:s0 tclass=file permissive=0

ferryfax avatar Mar 31 '17 04:03 ferryfax

I can confirm what @ferryfax says. It happens only on some Samsung devices and it does not stop lives sync, it is just error on console.

dtopuzov avatar Apr 24 '17 14:04 dtopuzov

@ferryfax please give it a try with latest cli: npm install -g nativescript@next

Plamen5kov avatar Aug 17 '17 08:08 Plamen5kov

@Plamen5kov Here is what happens with @next

Project successfully prepared (Android)
Successfully transferred app.css.
Refreshing application...
System.err: remove failed: EACCES (Permission denied) : /data/local/tmp/org.nativescript.TestApp/sync/app.css
System.err: remove failed: EACCES (Permission denied) : /data/local/tmp/org.nativescript.TestApp/sync
System.err: remove failed: ENOENT (No such file or directory) : /data/local/tmp/org.nativescript.TestApp/removedsync
Successfully synced application org.nativescript.TestApp on device 0715f791139b1a36.
Preparing project...
Project successfully prepared (Android)
Successfully transferred main-view-model.js.
Refreshing application...
System.err: remove failed: EACCES (Permission denied) : /data/local/tmp/org.nativescript.TestApp/sync/main-view-model.js
System.err: remove failed: EACCES (Permission denied) : /data/local/tmp/org.nativescript.TestApp/sync
System.err: remove failed: ENOENT (No such file or directory) : /data/local/tmp/org.nativescript.TestApp/removedsync
ActivityManager: Killing 15255:org.nativescript.TestApp/u0a1261 (adj 0): stop org.nativescript.TestApp cause from pid 15770
ActivityManager: cleanUpApplicationRecord -- 15255
Successfully synced application org.nativescript.TestApp on device 0715f791139b1a36.
Preparing project...
Project successfully prepared (Android)
Successfully transferred main-view-model.js.
Refreshing application...
System.err: remove failed: EACCES (Permission denied) : /data/local/tmp/org.nativescript.TestApp/sync/main-view-model.js
System.err: remove failed: EACCES (Permission denied) : /data/local/tmp/org.nativescript.TestApp/sync
System.err: remove failed: ENOENT (No such file or directory) : /data/local/tmp/org.nativescript.TestApp/removedsync
System.err: com.tns.NativeScriptException: 
System.err: Calling js method run failed
System.err: TypeError: Cannot set property '_modal' of null
System.err: File: "file:///data/data/org.nativescript.TestApp/files/app/tns_modules/tns-core-modules/ui/page/page-common.js, line: 211, column: 22
System.err: StackTrace: 
System.err: 	Frame: function:'PageBase._showNativeModalView', file:'file:///data/data/org.nativescript.TestApp/files/app/tns_modules/tns-core-modules/ui/page/page-common.js', line: 211, column: 23
System.err: 	Frame: function:'Page._showNativeModalView', file:'file:///data/data/org.nativescript.TestApp/files/app/tns_modules/tns-core-modules/ui/page/page.js', line: 112, column: 47
System.err: 	Frame: function:'PageBase.showModal', file:'file:///data/data/org.nativescript.TestApp/files/app/tns_modules/tns-core-modules/ui/page/page-common.js', line: 172, column: 18
System.err: 	Frame: function:'', file:'file:///data/data/org.nativescript.TestApp/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 24, column: 25
System.err: 	Frame: function:'invoke', file:'file:///data/data/org.nativescript.TestApp/files/app/tns_modules/tns-core-modules/timer/timer.js', line: 19, column: 48
System.err: 	Frame: function:'run', file:'file:///data/data/org.nativescript.TestApp/files/app/tns_modules/tns-core-modules/timer/timer.js', line: 23, column: 13
System.err: 	at com.tns.Runtime.callJSMethodNative(Native Method)
System.err: 	at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1043)
System.err: 	at com.tns.Runtime.callJSMethodImpl(Runtime.java:925)
System.err: 	at com.tns.Runtime.callJSMethod(Runtime.java:912)
System.err: 	at com.tns.Runtime.callJSMethod(Runtime.java:896)
System.err: 	at com.tns.Runtime.callJSMethod(Runtime.java:888)
System.err: 	at com.tns.gen.java.lang.Runnable.run(Runnable.java:10)
System.err: 	at android.os.Handler.handleCallback(Handler.java:739)
System.err: 	at android.os.Handler.dispatchMessage(Handler.java:95)
System.err: 	at android.os.Looper.loop(Looper.java:158)
System.err: 	at android.app.ActivityThread.main(ActivityThread.java:7229)
System.err: 	at java.lang.reflect.Method.invoke(Native Method)
System.err: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
System.err: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
ActivityManager: Process org.nativescript.TestApp (pid 15809)(adj 0) has died(74,1237)
ActivityManager: cleanUpApplicationRecord -- 15809
Successfully synced application org.nativescript.TestApp on device 0715f791139b1a36.

It looks livesync works (at least in basic scenarios), but we still log a log of errors.

Tested with:

[email protected]
[email protected]
[email protected]

dtopuzov avatar Aug 18 '17 07:08 dtopuzov

@dtopuzov can you give me the steps to reproduce and the API level and model of the device you tested on.

Plamen5kov avatar Aug 18 '17 11:08 Plamen5kov

@Plamen5kov Galaxy S6 Edge, Android 6.0

Steps:

tns create TestApp
tns run android
change app.css (change theme from light to dark)
change main-view-model.js (replace counter from 42 to 52)

dtopuzov avatar Aug 18 '17 12:08 dtopuzov

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.

rosen-vladimirov avatar Aug 05 '18 11:08 rosen-vladimirov