dimaportenko / magento-react-native

React Native mobile app for Magento 2.x
MIT License
297 stars 158 forks source link

Android app - Compilation - Network Request Failed #141

Closed Ank1304 closed 4 years ago

Ank1304 commented 4 years ago

Describe the bug The app throws error : "Network request failed" on launch

Expected behavior The app should open the store when launch the android app

Current Behavior The app launches just fine, but on launch - at the home page, it throws error : Network request failed. It is as if the app is not even able to communicate with the internet

Steps to Reproduce Please provide detailed steps for reproducing the issue.

  1. Compile the app using gradlew clean && gradlew assembleRelease -x bundleReleaseJsAndAssets with the store settings in magento.js
  2. Move the apk to android phone
  3. Install the app
  4. At the home page : "Network Request failed"

Screenshots If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

Additional context If you need additional info, please let me know, I will share it

dimaportenko commented 4 years ago

hey @Ank1304, do you have trails slash in the end of your website URL like in magento-sample.js ?

url: 'http://mage2.local/', // make sure you have trail slash in the end

also, did you check video tutorial https://www.youtube.com/watch?v=W82p3WfwxrA? this point mentioned there.

Ank1304 commented 4 years ago

hey @troublediehard

I do have a trailing slash at the end. I think this could be because of the fetch library. Do you have any alternative that we can use instead of fetch ?

dimaportenko commented 4 years ago

share logs from Remote JS Debugging https://reactnative.dev/docs/debugging

dimaportenko commented 4 years ago

@Ank1304 did you solve it?