Cordova应用突然间没有互联网连接;似乎没有任何解决办法

时间:2019-10-03 11:37:20

标签: android cordova ionic-framework

摘要/上下文

我已经花了8个小时试图解决似乎没有任何可行解决方案的问题:突然之间,我的Ionic Cordova项目在连接到Internet时就开始出现问题。

我试图安装Firebase并设置FCM,这使我陷入了这个问题。我最终回滚到一个稳定的版本,该版本运行良好,并且没有任何问题。但是问题仍然存在。到目前为止,在此问题得到解决之前,我的应用程序已经完全失效且无用。

说明问题

  • 该应用程序无法连接到Internet。 Android平台文件夹的构建与APK一样完美,但打开该应用程序后,无法从我的服务器中获取资源。
  • 它也无法访问其他通用Internet资源。举例来说,执行fetch('http://www.google.com')会返回404状态。
  • 过去,我通过激活Chrome的“远程设备”选项,直接在设备中测试APK,激活了开发人员调试选项。现在,它绝对检测不到任何东西。
  • 听起来很奇怪,在导航器中通过ionic serve测试该应用程序时,它运行正常,可以正常访问我的服务器资源并正常执行网络请求。

到目前为止,我已经尝试过:

  • 更改我的Node版本。我都尝试了LTS和最新版本(v12.11.1),但都给出了完全相同的结果。
  • 将Cordova更新到最新版本,并将其回滚到7.1,但是它们都不起作用。
  • 安装/卸载Cordova Androidx和Cordova Androidx适配器插件。
  • 当然,在上述每个步骤中,删除并重新创建android平台。
  • 添加一个<meta>标记以接受所有请求,如另一个线程中所建议的那样。
  • <allow-navigation href="*" />添加到config.xml文件中。

系统和设置:

使用命令ionic info生成的转储:

Ionic:

   Ionic CLI                     : 5.2.5 (C:\Users\zerok\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.0.0
   @angular-devkit/build-angular : 0.12.4
   @angular-devkit/schematics    : 7.3.0
   @angular/cli                  : 7.1.0
   @ionic/angular-toolkit        : 1.3.0

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : android 8.1.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 12 other plugins)

Utility:

   cordova-res : 0.7.0
   native-run  : not installed

System:

   NodeJS : v12.11.1 (C:\Program Files\nodejs\node.exe)
   npm    : 6.11.3
   OS     : Windows 10

在小米Pocophone(Android 9)中进行测试

使用ionic cordova build android 构建应用时记录:

ionic cordova build android
> ng.cmd run app:ionic-cordova-build --platform=android

Date: 2019-10-03T11:29:32.113Z
Hash: 12ee885cabf55c31b9b6
Time: 12152ms
chunk {0} 0.js, 0.js.map () 16.6 kB  [rendered]
chunk {1} 1.js, 1.js.map () 12.8 kB  [rendered]
chunk {2} 2.js, 2.js.map () 17.1 kB  [rendered]
chunk {3} 3.js, 3.js.map () 1.45 kB  [rendered]
chunk {4} 4.js, 4.js.map () 93.7 kB  [rendered]
chunk {5} 5.js, 5.js.map () 3.22 kB  [rendered]
chunk {6} 6.js, 6.js.map () 1000 bytes  [rendered]
chunk {7} 7.js, 7.js.map () 5.28 kB  [rendered]
chunk {8} 8.js, 8.js.map () 1.4 kB  [rendered]
chunk {9} 9.js, 9.js.map () 1.73 kB  [rendered]
chunk {10} 10.js, 10.js.map () 29.5 kB  [rendered]
chunk {11} 11.js, 11.js.map () 30.4 kB  [rendered]
chunk {12} 12.js, 12.js.map () 31 kB  [rendered]
chunk {13} 13.js, 13.js.map () 32.2 kB  [rendered]
chunk {14} 14.js, 14.js.map () 24.7 kB  [rendered]39m
chunk {15} 15.js, 15.js.map () 25.5 kB  [rendered]
chunk {16} 16.js, 16.js.map () 21.1 kB  [rendered]
chunk {17} 17.js, 17.js.map () 21.5 kB  [rendered]
chunk {18} 18.js, 18.js.map () 23.1 kB  [rendered]
chunk {19} 19.js, 19.js.map () 23.1 kB  [rendered]
chunk {20} 20.js, 20.js.map () 48.8 kB  [rendered]
chunk {21} 21.js, 21.js.map () 48.8 kB  [rendered]
chunk {22} 22.js, 22.js.map () 26.3 kB  [rendered]
chunk {23} 23.js, 23.js.map () 27.8 kB  [rendered]
chunk {24} 24.js, 24.js.map () 30.5 kB  [rendered]
chunk {25} 25.js, 25.js.map () 30.9 kB  [rendered]
chunk {26} 26.js, 26.js.map () 31.1 kB  [rendered]
chunk {27} 27.js, 27.js.map () 31.4 kB  [rendered]
chunk {28} 28.js, 28.js.map () 24.1 kB  [rendered]
chunk {29} 29.js, 29.js.map () 24.6 kB  [rendered]
chunk {30} 30.js, 30.js.map () 26.3 kB  [rendered]
chunk {31} 31.js, 31.js.map () 27.8 kB  [rendered]
chunk {32} 32.js, 32.js.map () 32 kB  [rendered]
chunk {33} 33.js, 33.js.map () 33.1 kB  [rendered]
chunk {34} 34.js, 34.js.map () 23.6 kB  [rendered]
chunk {35} 35.js, 35.js.map () 24.1 kB  [rendered]
chunk {36} 36.js, 36.js.map () 31.5 kB  [rendered]
chunk {37} 37.js, 37.js.map () 32.5 kB  [rendered]
chunk {38} 38.js, 38.js.map () 23.4 kB  [rendered]
chunk {39} 39.js, 39.js.map () 23.9 kB  [rendered]
chunk {40} 40.js, 40.js.map () 48.8 kB  [rendered]
chunk {41} 41.js, 41.js.map () 48.8 kB  [rendered]
chunk {42} 42.js, 42.js.map () 30.5 kB  [rendered]
chunk {43} 43.js, 43.js.map () 31 kB  [rendered]
chunk {44} 44.js, 44.js.map () 23.1 kB  [rendered]
chunk {45} 45.js, 45.js.map () 23.1 kB  [rendered]
chunk {46} 46.js, 46.js.map9m () 28.6 kB  [rendered]
chunk {47} 47.js, 47.js.map () 28.7 kB  [rendered]
chunk {48} 48.js, 48.js.map () 21.1 kB  [rendered]
chunk {49} 49.js, 49.js.map () 21.6 kB  [rendered]
chunk {50} 50.js, 50.js.map () 25.6 kB  [rendered]
chunk {51} 51.js, 51.js.map () 25.6 kB  [rendered]
chunk {52} 52.js, 52.js.map () 31.2 kB  [rendered]
chunk {53} 53.js, 53.js.map () 31.2 kB  [rendered]
chunk {54} 54.js, 54.js.map () 31 kB  [rendered]
chunk {55} 55.js, 55.js.map () 31.2 kB  [rendered]
chunk {56} 56.js, 56.js.map () 25.5 kB  [rendered]
chunk {57} 57.js, 57.js.map () 25.5 kB  [rendered]
chunk {58} 58.js, 58.js.map () 16.8 kB  [rendered]
chunk {59} 59.js, 59.js.map () 17.1 kB  [rendered]
chunk {60} 60.js, 60.js.map () 20.6 kB  [rendered]
chunk {61} 61.js, 61.js.map () 20.7 kB  [rendered]
chunk {62} 62.js, 62.js.map () 29.9 kB  [rendered]
chunk {63} 63.js, 63.js.map () 29.9 kB  [rendered]
chunk {64} 64.js, 64.js.map () 25.4 kB  [rendered]
chunk {65} 65.js, 65.js.map () 26.2 kB  [rendered]
chunk {66} 66.js, 66.js.map () 21.2 kB  [rendered]
chunk {67} 67.js, 67.js.map () 21.2 kB  [rendered]
chunk {68} 68.js, 68.js.map () 24.1 kB  [rendered]
chunk {69} 69.js, 69.js.map () 25.7 kB  [rendered]
chunk {70} 70.js, 70.js.map () 38.9 kB  [rendered]
chunk {71} 71.js, 71.js.map () 39.5 kB  [rendered]
chunk {72} 72.js, 72.js.map () 18.7 kB  [rendered]
chunk {73} 73.js, 73.js.map () 18.7 kB  [rendered]
chunk {74} 74.js, 74.js.map () 38.8 kB  [rendered]
chunk {75} 75.js, 75.js.map () 39.5 kB  [rendered]
chunk {76} 76.js, 76.js.map () 33.5 kB  [rendered]
chunk {77} 77.js, 77.js.map () 33.5 kB  [rendered]22m
chunk {78} 78.js, 78.js.map () 13.1 kB  [rendered]
chunk {79} 79.js, 79.js.map () 13.1 kB  [rendered]
chunk {80} 80.js, 80.js.map () 26.5 kB  [rendered]
chunk {81} 81.js, 81.js.map () 27.7 kB  [rendered]
chunk {82} 82.js, 82.js.map () 18.7 kB  [rendered]
chunk {83} 83.js, 83.js.map () 18.7 kB  [rendered]
chunk {84} 84.js, 84.js.map () 17.8 kB  [rendered]
chunk {85} 85.js, 85.js.map () 18.2 kB  [rendered]
chunk {86} 86.js, 86.js.map () 20.4 kB  [rendered]
chunk {87} 87.js, 87.js.map () 20.7 kB  [rendered]
chunk {88} 88.js, 88.js.map () 21.2 kB  [rendered]
chunk {89} 89.js, 89.js.map () 21.2 kB  [rendered]
chunk {90} 90.js, 90.js.map () 16 kB  [rendered]
chunk {91} 91.js, 91.js.map () 16.1 kB  [rendered]
chunk {92} 92.js, 92.js.map () 15.9 kB  [rendered]
chunk {93} 93.js, 93.js.map () 16 kB m [rendered]
chunk {94} 94.js, 94.js.map () 43.7 kB  [rendered]
chunk {95} 95.js, 95.js.map () 46 kB  [rendered]
chunk {96} 96.js, 96.js.map () 46.3 kB  [rendered]
chunk {97} 97.js, 97.js.map () 48.8 kB  [rendered]
chunk {98} 98.js, 98.js.map () 26.2 kB  [rendered]
chunk {99} 99.js, 99.js.map () 27.1 kB  [rendered]
chunk {100} 100.js, 100.js.map () 23.6 kB  [rendered]
chunk {101} 101.js, 101.js.map () 25.2 kB  [rendered]
chunk {102} 102.js, 102.js.map () 20.4 kB  [rendered]
chunk {103} 103.js, 103.js.map () 20.7 kB  [rendered]
chunk {104} 104.js, 104.js.map () 25.1 kB  [rendered]
chunk {105} 105.js, 105.js.map () 26.2 kB  [rendered]
chunk {106} 106.js, 106.js.map () 15.9 kB  [rendered]
chunk {107} 107.js, 107.js.map () 16.1 kB  [rendered]
chunk {108} 108.js, 108.js.map () 16.8 kB  [rendered]
chunk {109} 2m109.js, 109.js.map () 17.1 kB  [rendered]
chunk {110} 110.js, 110.js.map () 20.7 kB  [rendered]
chunk {111} 111.js, 111.js.map () 20.7 kB  [rendered]
chunk {112} 112.js, 112.js.map () 15.9 kB  [rendered]
chunk {113} 113.js, 113.js.map () 16 kB  [rendered]
chunk {114} 114.js, 114.js.map () 42.1 kB  [rendered]
chunk {115} 115.js, 115.js.map () 42.4 kB  [rendered]
chunk {116} 116.js, 116.js.map () 6.39 kB  [rendered]
chunk {117} 117.js, 117.js.map () 6.47 kB  [rendered]
chunk {118} 118.js, 118.js.map () 6.39 kB  [rendered]
chunk {119} 119.js, 119.js.map () 6.46 kB  [rendered]
chunk {120} 120.js, 120.js.map () 42.5 kB  [rendered]
chunk {121} 121.js, 121.js.map () 42.7 kB  [rendered]
chunk {122} 122.js, 122.js.map () 19.8 kB  [rendered]
chunk {123} 123.js, 123.js.map () 19.8 kB  [rendered]
chunk {124} 124.js, 124.js.map () 17.8 kB [39m [rendered]
chunk {125} 125.js, 125.js.map () 17.9 kB  [rendered]
chunk {126} 126.js, 126.js.map () 17.2 kB  [rendered]
chunk {127} 127.js, 127.js.map () 17.2 kB  [rendered]
chunk {128} 128.js, 128.js.map () 17.2 kB  [rendered]
chunk {129} 129.js, 129.js.map () 17.3 kB  [rendered]
chunk {130} 130.js, 130.js.map () 13.6 kB  [rendered]
chunk {131} 131.js, 131.js.map () 13.7 kB  [rendered]
chunk {132} 132.js, 132.js.map () 14.3 kB  [rendered]
chunk {133} 133.js, 133.js.map () 14.3 kB  [rendered]
chunk {134} 134.js, 134.js.map () 10 kB  [rendered]
chunk {135} 135.js, 135.js.map () 10.1 kB  [rendered]
chunk {136} 136.js, 136.js.map () 17.3 kB  [rendered]
chunk {137} 137.js, 137.js.map () 17.3 kB  [rendered]
chunk {138} 138.js, 138.js.map () 12.8 kB  [rendered]
chunk {139} 139.js, 139.js.map () 12.8 kB  [rendered]
chunk {[33m140} 140.js, 140.js.map () 3.73 kB  [rendered]
chunk {141} 141.js, 141.js.map () 1.6 kB  [rendered]
chunk {142} 142.js, 142.js.map () 23.9 kB  [rendered]
chunk {143} 143.js, 143.js.map () 23.9 kB  [rendered]
chunk {144} 144.js, 144.js.map () 14.2 kB  [rendered]
chunk {145} 145.js, 145.js.map () 14.4 kB  [rendered]
chunk {146} 146.js, 146.js.map () 2.4 kB  [rendered]
chunk {147} 147.js, 147.js.map () 2.43 kB  [rendered]
chunk {148} 148.js, 148.js.map () 23.8 kB  [rendered]
chunk {149} 149.js, 149.js.map () 23.8 kB  [rendered]
chunk {150} 150.js, 150.js.map () 24.5 kB  [rendered]
chunk {151} 151.js, 151.js.map () 25 kB  [rendered]
chunk {152} 152.js, 152.js.map () 9.83 kB  [rendered]
chunk {153} 153.js, 153.js.map () 9.84 kB  [rendered]
chunk {154} 154.js, 154.js.map () 10.4 kB  [rendered]
chunk {155} 155.js, 155.js.map2m () 10.7 kB  [rendered]
chunk {156} 156.js, 156.js.map () 10.9 kB  [rendered]
chunk {157} 157.js, 157.js.map () 10.9 kB  [rendered]
chunk {158} 158.js, 158.js.map () 10.1 kB  [rendered]
chunk {159} 159.js, 159.js.map () 10.3 kB  [rendered]
chunk {160} 160.js, 160.js.map () 13.3 kB  [rendered]
chunk {161} 161.js, 161.js.map () 13.4 kB  [rendered]
chunk {162} 162.js, 162.js.map () 25.5 kB  [rendered]
chunk {163} 163.js, 163.js.map () 26 kB  [rendered]
chunk {164} 164.js, 164.js.map () 10.8 kB  [rendered]
chunk {165} 165.js, 165.js.map () 10.8 kB  [rendered]
chunk {166} 166.js, 166.js.map () 3.08 kB  [rendered]
chunk {167} 167.js, 167.js.map () 12 kB  [rendered]
chunk {168} 168.js, 168.js.map () 14.6 kB  [rendered]
chunk {169} 169.js, 169.js.map () 7.92 kB  [rendered]
chunk {170} 170.js, 170.js.map () 1.63 kB  [rendered][39m
chunk {171} 171.js, 171.js.map () 1.36 kB  [rendered]
chunk {172} 172.js, 172.js.map () 5.03 kB  [rendered]
chunk {common} common.js, common.js.map (common) 18.5 kB  [rendered]
chunk {cordova} cordova.js, cordova.js.map (cordova) 63.5 kB [entry] [rendered]
chunk {default~event-creation-event-creation-module~event-page-event-page-module~map-map-module~place-page-~c14e8f5b} default~event-creation-event-creation-module~event-page-event-page-module~map-map-module~place-page-~c14e8f5b.js, default~event-creation-event-creation-module~event-page-event-page-module~map-map-module~place-page-~c14e8f5b.js.map (default~event-creation-event-creation-module~event-page-event-page-module~map-map-module~place-page-~c14e8f5b) 196 kB  [rendered]
chunk {default~event-page-event-page-module~events-manager-events-manager-module~map-map-module} default~event-page-event-page-module~events-manager-events-manager-module~map-map-module.js, default~event-page-event-page-module~events-manager-events-manager-module~map-map-module.js.map (default~event-page-event-page-module~events-manager-events-manager-module~map-map-module) 12.3 kB  [rendered]
chunk {event-creation-event-creation-module} event-creation-event-creation-module.js, event-creation-event-creation-module.js.map (event-creation-event-creation-module) 33.4 kB  [rendered]
chunk {event-page-event-page-module} event-page-event-page-module.js, event-page-event-page-module.js.map39m (event-page-event-page-module) 24 kB  [rendered]
chunk {events-manager-events-manager-module} events-manager-events-manager-module.js, events-manager-events-manager-module.js.map (events-manager-events-manager-module) 16.7 kB  [rendered]
chunk {login-login-module} login-login-module.js, login-login-module.js.map (login-login-module) 14.3 kB  [rendered]
chunk {main} main.js, main.js.map (main) 380 kB [initial] [rendered]
chunk {map-map-module} map-map-module.js, map-map-module.js.map (map-map-module) 37 kB  [rendered]
chunk {place-page-place-page-module} place-page-place-page-module.js, place-page-place-page-module.js.map (place-page-place-page-module) 49.4 kB  [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 236 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 9.63 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 85.2 kB [initial] [rendered]
chunk {user-stats-user-stats-module} user-stats-user-stats-module.js, user-stats-user-stats-module.js.map (user-stats-user-stats-module) 14.2 kB  [rendered]
chunk {user_profile-userprofile-module} user_profile-userprofile-module.js, user_profile-userprofile-module.js.map (user_profile-userprofile-module) 23 kB  [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 5.66 MB [initial] [rendered]
> cordova.cmd build android
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=C:\Users\zerok\AppData\Local\Android\sdk (DEPRECATED)
Subproject Path: CordovaLib
Subproject Path: app
> Task :app:preBuild UP-TO-DATE
> Task :CordovaLib:preBuild UP-TO-DATE
> Task :CordovaLib:preDebugBuild UP-TO-DATE
> Task :CordovaLib:checkDebugManifest UP-TO-DATE
> Task :CordovaLib:processDebugManifest UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :CordovaLib:compileDebugAidl NO-SOURCE
> Task :app:compileDebugAidl NO-SOURCE
> Task :CordovaLib:packageDebugRenderscript NO-SOURCE
> Task :app:compileDebugRenderscript UP-TO-DATE
> Task :app:checkDebugManifest UP-TO-DATE
> Task :app:generateDebugBuildConfig UP-TO-DATE
> Task :app:prepareLintJar UP-TO-DATE
> Task :app:generateDebugSources UP-TO-DATE
> Task :CordovaLib:compileDebugRenderscript UP-TO-DATE
> Task :CordovaLib:generateDebugBuildConfig UP-TO-DATE
> Task :CordovaLib:generateDebugResValues UP-TO-DATE
> Task :CordovaLib:generateDebugResources UP-TO-DATE
> Task :CordovaLib:packageDebugResources UP-TO-DATE
> Task :CordovaLib:generateDebugRFile UP-TO-DATE
> Task :CordovaLib:prepareLintJar UP-TO-DATE
> Task :CordovaLib:generateDebugSources UP-TO-DATE
> Task :CordovaLib:javaPreCompileDebug UP-TO-DATE
> Task :CordovaLib:compileDebugJavaWithJavac UP-TO-DATE
> Task :CordovaLib:processDebugJavaRes NO-SOURCE
> Task :CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug UP-TO-DATE
> Task :app:javaPreCompileDebug UP-TO-DATE
> Task :app:mainApkListPersistenceDebug UP-TO-DATE
> Task :app:generateDebugResValues UP-TO-DATE
> Task :app:generateDebugResources UP-TO-DATE
> Task :app:mergeDebugResources
> Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
> Task :app:processDebugManifest UP-TO-DATE
> Task :app:processDebugResources
> Task :app:compileDebugJavaWithJavac UP-TO-DATE
> Task :app:compileDebugNdk NO-SOURCE
> Task :app:compileDebugSources UP-TO-DATE
> Task :app:mergeDebugShaders UP-TO-DATE
> Task :app:compileDebugShaders UP-TO-DATE
> Task :app:generateDebugAssets UP-TO-DATE
> Task :CordovaLib:mergeDebugShaders UP-TO-DATE
> Task :CordovaLib:compileDebugShaders UP-TO-DATE
> Task :CordovaLib:generateDebugAssets UP-TO-DATE
> Task :CordovaLib:packageDebugAssets UP-TO-DATE
> Task :app:mergeDebugAssets UP-TO-DATE
> Task :app:validateSigningDebug UP-TO-DATE
> Task :app:signingConfigWriterDebug UP-TO-DATE
> Task :app:transformClassesWithDexBuilderForDebug UP-TO-DATE
> Task :app:transformDexArchiveWithDexMergerForDebug UP-TO-DATE
> Task :app:mergeDebugJniLibFolders UP-TO-DATE
> Task :CordovaLib:compileDebugNdk NO-SOURCE
> Task :CordovaLib:mergeDebugJniLibFolders UP-TO-DATE
> Task :CordovaLib:transformNativeLibsWithMergeJniLibsForDebug UP-TO-DATE
> Task :CordovaLib:transformNativeLibsWithIntermediateJniLibsForDebug UP-TO-DATE
> Task :app:transformNativeLibsWithMergeJniLibsForDebug UP-TO-DATE
> Task :app:processDebugJavaRes NO-SOURCE
> Task :app:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
> Task :app:packageDebug
> Task :app:assembleDebug
> Task :app:cdvBuildDebug

BUILD SUCCESSFUL in 8s
42 actionable tasks: 3 executed, 39 up-to-date

Cordova插件列表:

cordova-plugin-camera 4.0.3 "Camera"
cordova-plugin-datepicker 0.9.3 "DatePicker"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-filepath 1.5.1 "cordova-plugin-filepath"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 4.1.1 "cordova-plugin-ionic-webview"
cordova-plugin-native-spinner 1.1.3 "Native Spinner"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-telerik-imagepicker 2.2.4 "ImagePicker"
cordova-plugin-whitelist 1.3.4 "Whitelist"
phonegap-plugin-multidex 1.0.0 "Multidex"

Package.json内容:

{
  "name": "dromous",
  "version": "0.0.1",
  "author": "ByGymApp",
  "homepage": "http://dromousapp.com/",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@agm/core": "^1.0.0-beta.5",
    "@angular/common": "~7.2.3",
    "@angular/compiler-cli": "^7.1.0",
    "@angular/core": "~7.2.3",
    "@angular/forms": "~7.2.3",
    "@angular/http": "~7.2.3",
    "@angular/platform-browser": "~7.2.3",
    "@angular/platform-browser-dynamic": "~7.2.3",
    "@angular/router": "~7.2.3",
    "@ionic-native/background-mode": "^5.2.0",
    "@ionic-native/core": "5.0.0",
    "@ionic-native/date-picker": "^5.2.0",
    "@ionic-native/geolocation": "^5.0.0",
    "@ionic-native/image-picker": "^5.2.0",
    "@ionic-native/spinner-dialog": "^5.0.0",
    "@ionic-native/splash-screen": "5.0.0",
    "@ionic-native/status-bar": "5.0.0",
    "@ionic-native/stripe": "^4.20.0",
    "@ionic/angular": "4.0.0",
    "@types/googlemaps": "^3.37.0",
    "@types/parse": "^2.1.0",
    "chart.js": "^2.7.3",
    "cordova-android": "^8.1.0",
    "cordova-plugin-datepicker": "0.9.3",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-geolocation": "^4.0.1",
    "cordova-plugin-ionic-keyboard": "^2.1.3",
    "cordova-plugin-ionic-webview": "^4.1.1",
    "cordova-plugin-native-spinner": "^1.1.3",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-telerik-imagepicker": "2.2.4",
    "cordova-plugin-whitelist": "^1.3.4",
    "cordova-res": "^0.7.0",
    "core-js": "^2.5.3",
    "crypto-js": "^3.1.9-1",
    "moment": "^2.24.0",
    "ng2-charts": "^1.6.0",
    "parse": "^2.1.0",
    "phonegap-plugin-multidex": "^1.0.0",
    "recursive-readdir": "^2.2.2",
    "rxjs": "6.4.0",
    "rxjs-compat": "^6.5.3",
    "sharp": "^0.23.1",
    "typescript": "^3.1.6",
    "whitelist": "^1.0.2",
    "zone.js": "^0.8.29"
  },
  "devDependencies": {
    "@angular-devkit/architect": "^0.13.0",
    "@angular-devkit/build-angular": "^0.12.4",
    "@angular-devkit/core": "^7.3.0",
    "@angular-devkit/schematics": "^7.3.0",
    "@angular/cli": "7.1.0",
    "@angular/compiler": "~7.2.3",
    "@angular/language-service": "~7.2.3",
    "@ionic/angular-toolkit": "^1.3.0",
    "@types/chartjs": "0.0.31",
    "@types/jasmine": "^3.3.8",
    "@types/jasminewd2": "^2.0.6",
    "@types/node": "^10.12.21",
    "codelyzer": "~4.5.0",
    "jasmine-core": "~3.3.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.0",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.0",
    "node-sass": "^4.12.0",
    "protractor": "^5.4.2",
    "ts-node": "~8.0.2",
    "tslint": "~5.12.1"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-geolocation": {
        "GEOLOCATION_USAGE_DESCRIPTION": "To locate you"
      },
      "cordova-plugin-statusbar": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-keyboard": {},
      "cordova-plugin-native-spinner": {},
      "cordova-plugin-datepicker": {},
      "cordova-plugin-telerik-imagepicker": {},
      "cordova-plugin-ionic-webview": {
        "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
      },
      "cordova-plugin-whitelist": {}
    },
    "platforms": [
      "android"
    ]
  }
}

在这里,我将非常感谢您的帮助...

1 个答案:

答案 0 :(得分:2)

api 28及更高版本中的

默认情况下,cleartextTraffic是禁用的。因此,需要在清单中将其设置为true。 加 android:usesCleartextTraffic="true"在清单标签中的application标签中。 或定义网络配置文件 在这里看到更多 https://developer.android.com/training/articles/security-config