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

React Native app works fine on ios but Axios network request in android not working #45489

Open
benevolentsocialplanner opened this issue Jul 17, 2024 · 6 comments
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Needs: Triage 🔍 Newer Patch Available Platform: Android Android applications. Platform: iOS iOS applications.

Comments

@benevolentsocialplanner

Description

##React Native app works fine on ios but Axios network request in android not working

Will work fine in ios but in android it's not gonna send any requests. In flipper's network section i cant see any requests going out or coming in.
I'm not on localhost so replacing it with 10.0.0.2 won't help.
my backend url is like http://x.x.x.x:8000/

java version 20.0.0.2
gradle version 8.3
also tried many other java and gradle versions.

help is appreciated, thanks.

Steps to reproduce

not provided

React Native Version

0.73.7

Affected Platforms

Runtime - Android

Output of npx react-native info

System:
OS: macOS 14.4.1
CPU: (8) arm64 Apple M2
Memory: 97.06 MB / 8.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 20.10.0
path: ~/.nvm/versions/node/v20.10.0/bin/node
Yarn:
version: 1.22.21
path: ~/.nvm/versions/node/v20.10.0/bin/yarn
npm:
version: 10.2.3
path: ~/.nvm/versions/node/v20.10.0/bin/npm
Watchman:
version: 2024.07.01.00
path: /usr/local/bin/watchman
Managers:
CocoaPods:
version: 1.15.2
path: /usr/local/lib/ruby/gems/3.3.0/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.4
- iOS 17.4
- macOS 14.4
- tvOS 17.4
- visionOS 1.1
- watchOS 10.4
Android SDK:
API Levels:
- "31"
- "33"
- "33"
- "33"
- "34"
- "34"
- "35"
Build Tools:
- 30.0.3
- 33.0.0
- 33.0.1
- 34.0.0
- 35.0.0
System Images:
- android-33 | Google TV ARM 64 v8a
- android-33 | Google Play ARM 64 v8a
- android-34 | Google APIs ARM 64 v8a
- android-35 | Google APIs ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2022.3 AI-223.8836.35.2231.11005911
Xcode:
version: 15.3/15E204a
path: /usr/bin/xcodebuild
Languages:
Java:
version: 20.0.2
path: /Library/Java/JavaVirtualMachines/jdk-20.jdk/Contents/Home/bin/javac
Ruby:
version: 3.0.6
path: /usr/local/opt/ruby@3.0/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.73.7
wanted: ^0.73.7
react-native-macos: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: false

Stacktrace or Logs

Error i get in the logcat

AxiosError: Network Error, js engine: hermes, stack:
anonymous@689:2182
dispatchEvent@112:5649
value@105:8861
value@105:4802
anonymous@105:7580
value@23:788
value@10:847
value@39:3897
anonymous@39:693
value@39:2528
value@39:664
?anon_0_@665:625
n@7:69
p@7:317
tryCallOne@53:15
anonymous@139:26
anonymous@100:1667
k@100:498
w@100:888
callReactNativeMicrotasks@100:3058
value@39:2896
anonymous@39:983
value@39:2528
value@39:941
value@39:721

Reproducer

none

Screenshots and Videos

No response

@github-actions github-actions bot added Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels Jul 17, 2024
Copy link

⚠️ Missing Reproducible Example
ℹ️ We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.

Copy link

⚠️ Newer Version of React Native is Available!
ℹ️ You are on a supported minor version, but it looks like there's a newer patch available - 0.73.9. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

@github-actions github-actions bot added Platform: Android Android applications. Platform: iOS iOS applications. labels Jul 17, 2024
@migueldaipre
Copy link
Contributor

You need to use https or add cleartexttrafficpermitted in your AndroidManifest

@benevolentsocialplanner
Copy link
Author

You need to use https or add cleartexttrafficpermitted in your AndroidManifest


i did. it didnt help.

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Jul 17, 2024
@benevolentsocialplanner
Copy link
Author

The issue still persists.

@cortinico
Copy link
Contributor

The issue still persists.

Repro is still missing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Needs: Triage 🔍 Newer Patch Available Platform: Android Android applications. Platform: iOS iOS applications.
Projects
None yet
Development

No branches or pull requests

3 participants