在我的其中一个--livereload
标志起作用的项目中,该功能突然不起作用,但是在控制台上看到启动成功消息。
在我的android设备上启动该应用程序后,启动屏幕将一直保持打开状态,然后显示一条消息
Application Error
net::ERR_CONNECTION_TIMED_OUT
(http://192.168 .0.102:8100/)
我的配置XML具有以下内容:
<preference name="loadUrlTimeoutValue" value="700000" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="SplashScreen" value="screen" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="FadeSplashScreen" value="false" />
<preference name="SplashScreenDelay" value="300000" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="ShowSplashScreenSpinner" value="true" />
因此它特别提到了loadUrlTimeoutValue as 700000
-但这并没有积极的作用!
然后,我在Windows防火墙中添加了入站规则,以专门允许以下端口:8100, 35729, 53703
,这些端口通过以下命令出现在控制台上:
ionic cordova run android --livereload --consolelogs
> ionic-app-scripts serve --address 0.0.0.0 --port 8100 --livereload-port 35729
--dev-logger-port 53703 --consolelogs --nobrowser --iscordovaserve
--platform android --target cordova
[app-scripts] [19:00:36] ionic-app-scripts 3.2.1
[app-scripts] [19:00:36] watch started ...
[app-scripts] [19:00:36] build dev started ...
[app-scripts] [19:00:36] clean started ...
[app-scripts] [19:00:36] clean finished in less than 1 ms
[app-scripts] [19:00:36] copy started ...
[app-scripts] [19:00:36] deeplinks started ...
[app-scripts] [19:00:36] deeplinks finished in less than 1 ms
[app-scripts] [19:00:36] transpile started ...
[app-scripts] [19:00:41] transpile finished in 5.10 s
[app-scripts] [19:00:41] preprocess started ...
[app-scripts] [19:00:41] preprocess finished in 1 ms
[app-scripts] [19:00:41] webpack started ...
[app-scripts] [19:00:41] copy finished in 5.29 s
[app-scripts] [19:00:45] webpack finished in 3.63 s
[app-scripts] [19:00:45] sass started ...
[app-scripts] [19:00:46] sass finished in 1.00 s
[app-scripts] [19:00:46] postprocess started ...
[app-scripts] [19:00:46] postprocess finished in less than 1 ms
[app-scripts] [19:00:46] lint started ...
[app-scripts] [19:00:46] build dev finished in 9.92 s
[app-scripts] [19:00:46] watch ready in 9.98 s
[INFO] Development server running!
这也没有帮助..
最后,我向AndroidManifest.xml添加了以下权限-
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
那也不能解决问题。
我被上述问题困扰-如果有其他开发人员能让我摆脱这种汤,我将不胜感激!
谢谢。
Ionic:
ionic (Ionic CLI) : 4.12.0
Ionic Framework : ionic-angular 3.9.5
@ionic/app-scripts : 3.2.1
Cordova:
cordova (Cordova CLI) : not installed
Cordova Platforms : android 7.1.4
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3,
cordova- plugin-ionic-webview 3.1.2, (and 4 other plugins)
System:
Android SDK Tools : 26.1.1
NodeJS : v8.11.3
npm : 5.6.0
OS : Windows 7