nativescript errorPubNub 调用失败,查看状态了解详情

nativescript errorPubNub call failed, check status for details

我设置了 NativeScriptwithn angular 6 并且每个依赖项都已正确安装但是在这些步骤中出现以下错误

1) tns 运行 --bundle

2) 之后 select 选项同步到 Playground

3) 在我的 android 手机

中扫描 playground 应用程序中的二维码

4) 显示状态:成功发送平台 Android.

的初始文件

之后可以看到这个错误

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)

我也可以在 运行 项目后看到一些警告,命令 tns run --bundle

1)ANDROID_HOME环境变量未设置或指向不存在的目录。您将无法为 Android 执行任何与构建相关的操作。

2) 警告:来自 Android SDK 的 adb 未安装或未正确配置。

3) 警告:Android SDK 未安装或配置不正确。

4) 找不到兼容的 Android SDK 进行编译。为了能够为 Android 构建,请安装 Android SDK 28 或更高版本。 运行 $ sdkmanager 来管理您的 Android SDK 版本。

5) 您需要在系统上安装 Android SDK 构建工具。您可以安装以下范围内的任何版本:'>=23 <=28'.

您的 ANDROID_HOME 环境变量似乎未正确设置。您可以按照此问题的建议在不同的操作系统上进行设置。至少它会删除您收到的警告。

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

我解决了我的问题 此问题是在 Ubuntu 系统上设置环境 我提供 link 并遵循所有说明和命令 https://evothings.com/doc/build/cordova-install-linux.html 我希望每个人都使用这个 link 并解决你的问题

我也遇到了这个错误。

我的流程如下

  1. 我只是通过输入 tns create appName --ng
  2. 创建了我的 NativeScript 应用程序
  3. 然后我尝试通过输入 tns preview
  4. 打开应用程序

忘记了,问题是缺少安装 Latest NativeScriptCLI

修复了在目录

执行 npm install -g nativescript@latest