1

I set NativeScriptwithn angular 6 and every dependency is properly installed but got the below error with these steps

1) tns run --bundle

2) after that select option Sync to Playground

3) scan the QR code in playground app in my android mobile

4) show status: Successfully sent initial files for platform Android.

after that can see this error

Error: PubNub call failed, check the status for details at new PubNubError (/usr/local/lib/node_modules/nativescript/node_modules/pubnub/lib/core/components/core/components/endpoint.js:8:31) at onResponse (/usr/local/lib/node_modules/nativescript/node_modules/pubnub/lib/core/components/core/components/endpoint.js:126:32) at <anonymous> (/usr/local/lib/node_modules/nativescript/node_modules/pubnub/lib/networking/modules/networking/modules/web-node.js:59:17) at Request.callback (/usr/local/lib/node_modules/nativescript/node_modules/superagent/lib/node/index.js:728:3) at RequestBase._timeoutError (/usr/local/lib/node_modules/nativescript/node_modules/superagent/lib/request-base.js:676:8) at Timeout.<anonymous> (/usr/local/lib/node_modules/nativescript/node_modules/superagent/lib/request-base.js:685:12) at ontimeout (timers.js:475:11) at tryOnTimeout (timers.js:310:5) at Timer.listOnTimeout (timers.js:270:5)

Also I can see some warning after the run project with command tns run --bundle

1)The ANDROID_HOME environment variable is not set or it points to a non-existent directory. You will not be able to perform any build-related operations for Android.

2) WARNING: adb from the Android SDK is not installed or is not configured properly.

3)WARNING: The Android SDK is not installed or is not configured properly.

4) Cannot find a compatible Android SDK for compilation. To be able to build for Android, install Android SDK 28 or later. Run $ sdkmanager to manage your Android SDK versions.

5) You need to have the Android SDK Build-tools installed on your system. You can install any version in the following range: '>=23 <=28'.

Narendra
  • 4,514
  • 2
  • 21
  • 38
Vatsal Dashani
  • 75
  • 1
  • 11

3 Answers3

1

It looks like your ANDROID_HOME environment variable is not properly set. You may follow recommedations from this question to set it up on different OSs. At least it will remove warnings that you recieved.

Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions.

Daniel Deulin
  • 65
  • 2
  • 7
1

I solved my issue this issue is set the environment on Ubuntu systems I provide the link and follow all instruction and command https://evothings.com/doc/build/cordova-install-linux.html I hope everyone uses this link and solved your problem

Vatsal Dashani
  • 75
  • 1
  • 11
0

I also got this error.

My procedure is as follow

  1. I just create my NativeScript app by typing tns create appName --ng
  2. Then I tried to open the app with typing tns preview

Forgot and the problem is with missing to install Latest NativeScriptCLI

Fixed with executing the npm install -g nativescript@latest at the directory

Milinda Bandara
  • 542
  • 8
  • 23