Tns build stuck on Installing tns-android


#1

I am completely new to Nativescript and trying to set up my windows machine

I have installed nativescript via npm. It is at latest version (3.1)

tns doctor returns “Your coomponents are up-to-date”

When I run:
tns build android (or tns run android),

I get:
copying template files…
installing tns-androidInstalling tns-android
installing tns-android

It is stuck there with the twirling / sign.

I did an npm cache clear, uninstall nativescript and reinstall nativescript

I have the latest android studio installed with several android devices installed on it.

HELP!


#2

if this is the first time build :
it could be caused by your internet connection ,too slow or even blocked …etc
i would try another time or use a http/https/socks5/ proxy to find out

OR tns build android --log trace to see more infomation


#3

Thanks. When I run with --log trace, it errors with this message:

spawn: npm.cmd "install" "lazy@^1.0.11" "--save" "--save-dev" "--save-exact" "--silent" "--json" "--dry-run" "--prefix" "C:\Users\keith\NativeScriptProjects\HelloWorld" | Installing tns-androidNo manifest found in C:\Users\keith\NativeScriptProjects\HelloWorld\app\App_Resources\Android\AndroidManifest.xml

Error: sed: no such file or directory:
C:\Users\keith\NativeScriptProjects\HelloWorld\app\App_Resources\Android\app.gradle.
Check if you’re using an outdated template and update it.
\ Installing tns-androidExec npm uninstall tns-android --save
stdout: - tns-android@3.1.1 node_modules\tns-android

stderr:
Project successfully created.
Changes info in prepare platform: ProjectChangesInfo {
appFilesChanged: true,
appResourcesChanged: true,
modulesChanged: true,
configChanged: true }
Project dir from hooksArgs is:
C:\Users\keith\NativeScriptProjects\HelloWorld.
Hooks directories: [
‘C:\Users\keith\AppData\Roaming\npm\node_modules\nativescript\lib\hooks’,

‘C:\Users\keith\AppData\Roaming\npm\node_modules\nativescript\lib\common\hooks’,
‘C:\Users\keith\NativeScriptProjects\HelloWorld\hooks’ ]
BeforeHookName for command prepare is before-prepare
Preparing project…
No manifest found in
C:\Users\keith\NativeScriptProjects\HelloWorld\app\App_Resources\Android\AndroidManifest.xml
No manifest found in
C:\Users\keith\NativeScriptProjects\HelloWorld\app\App_Resources\Android\AndroidManifest.xml
Error: ENOENT: no such file or directory, scandir
’C:\Users\keith\NativeScriptProjects\HelloWorld\platforms\android\src\main\assets\app\App_Resources\Android’


#4

I think the solution your looking for has been answered on this topic:

I think that mostly your error is related to this:

No manifest found in
C:\Users\keith\NativeScriptProjects\HelloWorld\app\App_Resources\Android\AndroidManifest.xml
No manifest found in
C:\Users\keith\NativeScriptProjects\HelloWorld\app\App_Resources\Android\AndroidManifest.xml
Error: ENOENT: no such file or directory, scandir
'C:\Users\keith\NativeScriptProjects\HelloWorld\platforms\android\src\main\assets\app\App_Resources\Android'

#5

I don’t know what happened.

I reinitialized the app and it works. It could have been an out of date template.


#6

I realize that this is a very old thread, but just wanted to add that I still get this error on occasion and what’s worked for me is to reset my phone and try again.