Closed joshcomley closed 7 years ago
Hi,
I can pretty solidly recreate the bug, so hopefully you guys can too :)
First, clone a new project (in my case I'm using the Angular template):
tns create my-project --ng
Then run:
tns run android
Once it's up and running on the device, close the command window and fire up VS Code.
Try to debug from VS Code, you should get the "not authorized" problem.
In other words, if you run tns run/debug
from the command window first, then try to run from VS Code, it won't work.
Incidentally if you run from VS Code first and then from the console with tns run/debug
then tns
will no longer work with the same "not authorized" error, but VS Code will continue to do so until you delete out the platforms
directory.
In short: VS Code extension and tns
commands cannot both be run on the same project as they break each other, at least on Android.
I hope this helps someone fix the bug - perhaps this should be transferred to the tns
team as opposed to the VS Code plugin team, but I'll leave that up to you guys!
Thanks again, Josh
Hi @joshcomley ,
We've tried to reproduce your issue with different devices and API levels but we couldn't.
The warning message that "The device is not authorized" is usually shown when your phone is not connected with the machine ( you didn't give permissions to the machine to access device data). Still, this issue happens when adb hangs as well. To check if your devices are found by adb you can execute adb devices
. If this is your case you can restart adb -> adb kill-server
, adb will start automatically when you execute tns
command.
One more thing, tns processes are usually terminated with the key combination Ctrl + C
in the console, so can you confirm you terminate the process like that or you just close the terminal.
Write back if this helps or not. Thanks!
Closed due to inactivity
Hi there,
Sorry I'm not sure I ever saw your reply! Not sure I've quite got the hang of GitHub notifications.
Anyway, I have had this problem on three different PCs with three different phones, but I think it boils down to using USB 3.0. I have a USB 2.0 hub on my main PC, and using that (currently) seems to have resolved the issue.
Many thanks for your previous reply, apologies I never replied.
p.s. Of course now I'm using the lovely NativeScript SideKick instead (but I was still getting device not authorised every livesync update until I tried USB 2.0).
@joshcomley i had the same problem i changed to USB 2 and it worked. That is so weird
Hi all,
(Edit: I am using Windows 10)
If I create a new Angular template:
tns create some-app --ng
And try to run or debug from VS Code, then the following happens:
Some more info...
I have set up a completely fresh environment on a fresh Windows 10 machine, installing VS Code, NativeScript etc. on a totally different laptop and the same thing happens.
I have three Android phones:
Running from the command line with
tns run android
ortns debug android
works on all three devices every single timeOnce in a blue moon it works on the S7 and Z5, but probably 1 times out of 50
I have tried:
Nothing works, yet
tns run android
etc. work fine, as mentioned.I am running the extension version 0.7.2, and NativeScript version 3.1.2 and the latest (as of writing) version of VS Code.
Many thanks, Josh