Nativescript套接字连接超时

时间:2018-11-03 19:37:11

标签: android nativescript

最近,我开始面对Nativescript的一个奇怪问题。当我尝试使用 tns run android 运行android应用程序时,出现以下错误消息

无法在设备上应用更改:HQ64MZ576132。错误是:套接字连接超时。

我不知道如何确定实际问题。要解决此问题,我需要从另一个运行的本机脚本应用程序复制应用程序文件夹,然后替换存储库中的所有文件,最终我回到正常运行的应用程序。 以下是我想找出的答案:

  1. 如何确定是什么原因导致套接字连接超时
  2. 即使文件完全一样,为什么要替换整个应用程序也可以解决问题 对我来说没有意义吗?

以下是我的package.json

{
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "readme": "NativeScript Application",
  "repository": "<fill-your-repository-here>",
  "nativescript": {
    "id": "com.travel",
    "tns-android": {
      "version": "5.0.0"
    }
  },
  "scripts": {
    "lint": "tslint \"app/**/*.ts\""
  },
  "dependencies": {
    "nativescript-admob": "^1.4.2",
    "nativescript-appversion": "^1.4.1",
    "nativescript-exit": "^1.0.1",
    "nativescript-grid-view": "^3.4.0",
    "nativescript-purchase": "^2.0.5",
    "nativescript-social-share": "^1.5.0",
    "nativescript-theme-core": "1.0.4",
    "nativescript-toast": "^1.4.6",
    "nativescript-ui-chart": "^3.8.0",
    "nativescript-ui-sidedrawer": "^3.5.1",
    "rxjs": "5.5.2",
    "tns-core-modules": "^5.0.0"
  },
  "devDependencies": {
    "awesome-typescript-loader": "~3.1.3",
    "babel-traverse": "6.4.5",
    "babel-types": "6.4.5",
    "babylon": "6.4.5",
    "copy-webpack-plugin": "~4.3.0",
    "css-loader": "^0.28.11",
    "extract-text-webpack-plugin": "~3.0.2",
    "lazy": "1.0.11",
    "nativescript-dev-sass": "1.3.5",
    "nativescript-dev-typescript": "0.5.1",
    "nativescript-dev-webpack": "^0.16.2",
    "nativescript-worker-loader": "~0.8.1",
    "raw-loader": "~0.5.1",
    "resolve-url-loader": "~2.2.1",
    "sass-loader": "^6.0.7",
    "tns-platform-declarations": "^4.2.0",
    "tslint": "5.8.0",
    "typescript": "2.8.4",
    "uglifyjs-webpack-plugin": "~1.1.6",
    "webpack": "^3.12.0",
    "webpack-bundle-analyzer": "^2.13.1",
    "webpack-sources": "~1.1.0"
  }
}

谢谢

1 个答案:

答案 0 :(得分:1)

这是困扰我大部分时间的讨厌问题。这是nativescript-admob插件,导致应用程序中断。 Google Mobile Ads SDK版本17.0.0需要AndroidManifest.xml中的标签。您可以在https://developers.google.com/admob/android/quick-start#update_your_androidmanifestxml处找到更多信息。有一个临时出版物https://github.com/EddyVerbruggen/nativescript-admob/issues/45,其温度是临时的。 您将必须在AndroidManifest.xml中添加以下行

<application>
    <!-- this line needs to be added (replace the value!) -->
    <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-3940256099942544~3347511713" />

    <activity></activity>
</application>