Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expo app cannot fetch on some android devices #25610

Closed
haymouz opened this issue Jul 12, 2019 · 2 comments
Closed

Expo app cannot fetch on some android devices #25610

haymouz opened this issue Jul 12, 2019 · 2 comments
Labels
Bug 🌐Networking Related to a networking API. Platform: Android Android applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@haymouz
Copy link

haymouz commented Jul 12, 2019

Hey guys, I'm currently building a react-native app using expo. It has been running successfully on some android phones for a while not until I tried it on an android phone and it wasn't making network requests. I'm using "FETCH Api" and I clearly don't know why this should be happening.

I don't know if its an android target sdk thing or just a normal configuration thing. I need help

React Native version:

React Native Environment Info:
System:
OS: Windows 7
CPU: (4) x64 Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz
Memory: 1.46 GB / 5.91 GB
Binaries:
npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 3.0.0.0 AI-171.4443003

Important details in the package.json :
"expo": "^32.0.0",
"react": "16.5.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz",
"@babel/core": "^7.0.0",
"@expo/vector-icons": "^9.0.0",
"babel-polyfill": "^6.26.0",
"expr-eval": "^1.2.1",

Steps To Reproduce

  1. expo build:android

Describe what you expected to happen:
I expected the app to success fully make a fetch request

Snack, code example, or link to a repository:

Here's how the fetch request looks like

fetchUsers = () => {
AsyncStorage.getItem('tellerId').then((token) => {
var RMid= token;
this.setState({ loading: true });
fetch(Url+endpoint+RMid,{
headers: {
'cache-control': 'no-cache',
'content-type': 'application/json',
accept: 'application/json' },
})

.then((response) => response.json())
.then((res) => {
  if (res.error) {
    console.log(res.error);
  } 
  else {
    try{
      this.setState({ data: res, loading: false, });
      if (this.state.data.length === 0) { this.setState({ listEmpty: 'Nothing yet' }); }        
    console.log(this.state.data)
    }
    catch (e) {
      alert("Network Problem, Please Try Agian Later")
      console.error(e.message);
    }
  }
})
.catch((error) => {
  console.log(error);
})
.done();

});
}

@haymouz haymouz added the Bug label Jul 12, 2019
@react-native-bot react-native-bot added Platform: Android Android applications. 🌐Networking Related to a networking API. labels Jul 12, 2019
@stale
Copy link

stale bot commented Oct 10, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Oct 10, 2019
@stale
Copy link

stale bot commented Oct 17, 2019

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Oct 17, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Oct 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug 🌐Networking Related to a networking API. Platform: Android Android applications. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

2 participants