Nativescript 套接字连接超时 [英] Nativescript Socket connection timeouted

查看:45
本文介绍了Nativescript 套接字连接超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Recently I have started facing a strange issue with Nativescript. When I try to run the android application using tns run android I get following error message

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

我不知道如何确定实际问题.为了解决这个问题,我需要从另一个工作的 nativescript 应用程序复制 app 文件夹,然后替换存储库中的所有文件,最终我回到正常运行的应用程序.以下是我想弄清楚的:

I dont know how to identify the actual issue. To fix this issue, I need to copy app folder from another working nativescript application and then replace all the file from repository and eventually I am back to normal running application. Following is what I am trying to figure out:

  1. 如何确定导致套接字连接超时的原因?
  2. 为什么即使文件完全相同,更换整个应用程序也能解决问题同样的,这对我来说没有意义?

以下是我的 package.json

Following is my 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"
  }
}

谢谢

推荐答案

这个问题困扰了我大部分时间.这是导致应用程序中断的 nativescript-admob 插件.Google 移动广告 SDK 17.0.0 版需要 AndroidManifest.xml 中的标记.您可以在此处找到更多信息 https://developers.google.com/admob/android/快速启动#update_your_androidmanifestxml.有未解决的问题 https://github.com/EddyVerbruggen/nativescript-admob/issues/45 有一个温度.您必须将以下行添加到 AndroidManifest.xml

This has been a nasty issue which ate most of my days. It was nativescript-admob plugin which was causing application to break. Version 17.0.0 of Google Mobile Ads SDK requires tag in AndroidManifest.xml. You can find more info here https://developers.google.com/admob/android/quick-start#update_your_androidmanifestxml. There is open issue https://github.com/EddyVerbruggen/nativescript-admob/issues/45 which has a temp. You will have to add following line to 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>

这篇关于Nativescript 套接字连接超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆