본문 바로가기

Errors

[Expo] something went wrong! java.net.connectexception failed to connect to에러 해결

 

Expo를 잘 사용하던 와중 마주한 ,

Expo 앱 상 파란 화면과 함께 뜨는

 " Something went wrong!"

Sorry about that . You can go back to Expo home or try to reload the project

에러 해결방법입니다.

 

React Native 루트디렉토리 콘솔에는 

› Reloading apps 시 아래와 같은 문구가 출력됩니다. 
warn No apps connected. Sending "reload" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB.

 

먼저 자세한 에러 로그를 확인해야 해요! 

저는 이 에러 로그를 띄워주는 버튼을 못보고 헤맸..........................ㅎ 

expo 앱에서 나타난 파란색 화면(Something went wrong 메시지가 나타난 화면)
하단에 View error log 버튼을 클릭하면 에러 로그가 뜹니다.

저의 경우  java.net.connectexception failed to connect to xXx(내 로컬주소)가 떴어요. 

 

 

 

 

 

1번: Expo 캐시 삭제 (컴퓨터)

// 루트 디렉토리 진입 후
del node_modules
//계속하시겠습니까(Y/N)? 
y

npm cache clean --force

expo start --clear

여전히 해결안됨

 

2.번: Expo 모바일 앱 캐시 삭제 

(안드로이드 기준)

설정 - 에플리케이션 - Expo Go 선택- 저장공간 - 캐시 - 캐시삭제

다시 엑스포 시작

여전히 해결안됨 

 

 

2번과 3번 사이에 Expo 앱을 지웟다 다시 깔았다 데이터도 지워보고 로그아웃도 해보고

여러 과정이 있지만 생략...

 

3번 : 터널모드 

// 루트 디렉토리 진입 후
expo start --tunnel

 

해결 ~

이제 Expo 앱을 켜고 프로젝트에 들어가니 잘 로딩이 됩니다.

 

P.S  Expo로 개발하는 여러분 모두 화이팅..ㅎㅎㅠㅠ..ㅎㅎ

 

* 해결방법은 다를 수 있으며 아래 참고한 stackoverflow 링크입니다

 

https://stackoverflow.com/questions/52351197/cant-connect-my-android-phone-in-expo-react-native-project#comment127349184_52351197

 

Can't connect my Android Phone in Expo React Native Project

I'm using Expo App in my Android Device to connect into the my Laptop's Expo (Signed in both my same Expo's Account)I am also connected in the same network. Then I scanned my code then after that i...

stackoverflow.com