Ionic with crosswalk cannot access network

the ionic app works fine with the network, but after following this guide http://blog.ionic.io/crosswalk-comes-to-ionic/ to integrate the ionic with the crosswalk , the ionic app can launch properly but it cannot access the network , neither on simulator nor on the device. the permissions I grant for the ionic app are :

<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_COARSE_LOCATION” />
<uses-permission android:name=“android.permission.ACCESS_FINE_LOCATION” />
<uses-permission android:name=“android.permission.CHANGE_WIFI_STATE” />
<uses-permission android:name=“android.permission.READ_PHONE_STATE” />
<uses-permission android:name=“android.permission.WRITE_EXTERNAL_STORAGE” />
<uses-permission android:name=“android.permission.MOUNT_UNMOUNT_FILESYSTEMS” />
<uses-permission android:name=“android.permission.READ_LOGS” />

If anybody know how to fix this issue please help out…

Can you give more details on the exact error you’re getting? If you haven’t yet, hook it up to Logcat and see what it gives.

@thebosz thanks so much for reply .
LogCat log out something like these, it seems the network is blocked.

04-15 01:18:05.026: D/WifiStateMachine(513): ConnectedState{ what=131155 when=-2ms arg1=159 }
04-15 01:18:05.026: D/WifiStateMachine(513): L2ConnectedState{ what=131155 when=-2ms arg1=159 }
04-15 01:18:05.026: D/wpa_supplicant(750): wpa_s 0x40e35ed0 cmd SIGNAL_POLL
04-15 01:18:05.036: D/wpa_supplicant(750): nl80211: survey data missing!
04-15 01:18:05.266: I/Sensors(291): sns_pwr.c(307):releasing wakelock
04-15 01:18:05.386: I/Sensors(291): sns_pwr.c(279):acquiring wakelock
04-15 01:18:07.218: W/XWalkCordovaResourceClient(32642): URL blocked by whitelist: http://182.***.***.31:3000/api/users/login?include=user&rememberMe=true
04-15 01:18:07.228: I/chromium(32642): [INFO:CONSOLE(212)] “Redirect”, source: file:///android_asset/www/js/app.js (212)
04-15 01:18:07.238: I/chromium(32642): [INFO:CONSOLE(19890)] “TypeError: Cannot read property ‘message’ of undefined
04-15 01:18:07.238: I/chromium(32642): at file:///android_asset/www/js/login.js:46:68
04-15 01:18:07.238: I/chromium(32642): at file:///android_asset/www/lib/ionic/js/angular/angular-resource.js:618:30
04-15 01:18:07.238: I/chromium(32642): at processQueue (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:21472:27)
04-15 01:18:07.238: I/chromium(32642): at file:///android_asset/www/lib/ionic/js/ionic.bundle.js:21488:27
04-15 01:18:07.238: I/chromium(32642): at Scope.$eval (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:22684:28)
04-15 01:18:07.238: I/chromium(32642): at Scope.$digest (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:22500:31)
04-15 01:18:07.238: I/chromium(32642): at Scope.$apply (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:22789:24)
04-15 01:18:07.238: I/chromium(32642): at done (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:17942:47)
04-15 01:18:07.238: I/chromium(32642): at completeRequest (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:18132:7)
04-15 01:18:07.238: I/chromium(32642): at XMLHttpRequest.requestLoaded (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:18073:9)”, source: file:///android_asset/www/lib/ionic/js/ionic.bundle.js (19890)
04-15 01:18:08.039: D/WifiStateMachine(513): ConnectedState{ what=131155 when=-4ms arg1=159 }
04-15 01:18:08.049: D/WifiStateMachine(513): L2ConnectedState{ what=131155 when=-5ms arg1=159 }
04-15 01:18:08.049: D/wpa_supplicant(750): wpa_s 0x40e35ed0 cmd SIGNAL_POLL
04-15 01:18:08.059: D/wpa_supplicant(750): nl80211: survey data missing!

@thebosz, the log for the ionic app which works fine without crosswalk is as following:

4-15 01:30:47.219: D/WifiStateMachine(513): ConnectedState{ what=131155 when=-2ms arg1=163 }
04-15 01:30:47.219: D/WifiStateMachine(513): L2ConnectedState{ what=131155 when=-2ms arg1=163 }
04-15 01:30:47.219: D/wpa_supplicant(750): wpa_s 0x40e35ed0 cmd SIGNAL_POLL
04-15 01:30:47.229: D/wpa_supplicant(750): nl80211: survey data missing!
04-15 01:30:50.222: D/WifiStateMachine(513): ConnectedState{ what=131155 when=-2ms arg1=163 }
04-15 01:30:50.222: D/WifiStateMachine(513): L2ConnectedState{ what=131155 when=-2ms arg1=163 }
04-15 01:30:50.222: D/wpa_supplicant(750): wpa_s 0x40e35ed0 cmd SIGNAL_POLL
04-15 01:30:50.232: D/wpa_supplicant(750): nl80211: survey data missing!
04-15 01:30:50.803: D/PhoneInterfaceManager(923): Broadcasting intent ACTION_UNSOL_RESPONSE_OEM_HOOK_RAW
04-15 01:30:50.803: I/BatteryStatsImpl(513): Start partial wakelock RILJ(uid=1001, pid=923) nesting 2
04-15 01:30:50.843: I/BatteryStatsImpl(513): Stop partial wakelock RILJ(uid=1001, pid=923) nesting 1
04-15 01:30:53.245: D/WifiStateMachine(513): ConnectedState{ what=131155 when=-4ms arg1=163 }
04-15 01:30:53.245: D/WifiStateMachine(513): L2ConnectedState{ what=131155 when=-4ms arg1=163 }
04-15 01:30:53.245: D/wpa_supplicant(750): wpa_s 0x40e35ed0 cmd SIGNAL_POLL

@thebosz I find the solution from the stackoverflow. thanks so much . hope this can help others^_^

1 Like