[Expo]React Native 에서 Axios Network 에러steemCreated with Sketch.

in #upvulast year

React Native 에서 외부로 API를 호출 할 때, iOS는 되는데, Android는 안되는 문제가 있습니다.

AxiosError: [Network Error]

처음에는 Permission 문제인가 했는데 좀 찾아보니, Expo 프로젝트에서는 처음에 거의 모든 권한을 다 준다고 하더군요.

그래서 좀 더 찾아보니...

API 가 localhost 인 경우 문제가 안되는 문제가 있었습니다.
127.0.0.1도 마찬가지로 안됐구요.

그래서, 현재 PC가 쓰고 있는 실제 IP(공유기에서 알려주는 IP)를 주소로 설정하고 실행하니 되었습니다.

Fail : http://localhost:4000
Fail : http://127.0.0.1:4000
Success : http://192.168.0.2:4000

이런 문제들은 참 그냥 맞닥들이면 해결이 어렵네요!!

Sort:  

This post has been upvoted by @italygame witness curation trail


If you like our work and want to support us, please consider to approve our witness




CLICK HERE 👇

Come and visit Italy Community



Hi @happyberrysboy,
my name is @ilnegro and I voted your post using steem-fanbase.com.

Come and visit Italy Community

여전히 RN은 문제가 발생하면 해결하기가 어렵구나 ㅠ 그래도 해결해서 다행이야

해적 코인(PIR) 재단 재정 상황 3/18 (2023)
https://www.steemit.com/@pircoin/pir-318-2023

@pircoin님이 당신을 멘션하였습니다.
멘션을 받고 싶거나 받지 않으시려면 댓글을 남겨주세요. 빠른 시일내에 반영하도록 하겠습니다.

Coin Marketplace

STEEM 0.30
TRX 0.12
JST 0.034
BTC 64231.88
ETH 3128.59
USDT 1.00
SBD 3.95