인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

cdway's profile image
cdway

asked

[Code Factory] [Intermediate] Flutter Real Practice! State Management, Cache Management, Code Generation, GoRouter, Authentication Logic, etc. Essential Skills to Become an Intermediate!

Requesting Auth API with Dio

print(resp.data); 여기부터 안되네요

Written on

·

543

·

Edited

0

응답이 없네요

메세지가 안나와요

D/EGL_emulation( 5140): app_time_stats: avg=6131.28ms min=9.11ms max=12253.46ms count=2

이건만 나오는데

 

안드로이드 사용해서 ip 문제인가 해서

 

final ip = Platform.isAndroid ? simulatorIp : emulatorIp;

 

이걸로 바꾸어 봐도 안되구요

단, 메세지는 조금 달라졌습니다.

D/EGL_emulation( 7555): app_time_stats: avg=13725.68ms min=13725.68ms max=13725.68ms count=1

D/EGL_emulation( 7555): app_time_stats: avg=688.99ms min=273.39ms max=1104.59ms count=2

E/flutter ( 7555): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: DioError [DioErrorType.other]: SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = 127.0.0.1, port = 52818

E/flutter ( 7555): Source stack:

이하 생략...

 

 

해결 부탁드립니다.

flutter하이브리드-앱

Answer 3

0

백엔드 서버 켜셨나요?
저는 서버 켜니까 제대로 되네요!!

0

codefactory님의 프로필 이미지
codefactory
Instructor

안녕하세요!

아래 링크 한번 참고 해보시겠어요?

https://www.inflearn.com/questions/1226389/comment/329908

감사합니다!

0

codefactory님의 프로필 이미지
codefactory
Instructor

안녕하세요!

address = 127.0.0.1, port = 52818

127.0.0.1:52818로 요청을 보내고 계신 것 같습니다.

강의에서도 나오지만 127.0.0.1:3000에 요청을 보내야합니다. 서버 실행중인 포트가 3000번이기 때문입니다.

감사합니다!

cdway님의 프로필 이미지
cdway
Questioner

포트는 정확히 3000 표기 했는데요

아예

const ip = '127.0.0.1:3000';

사용했구요

밑에 첨부하는 메세지 보면 3번 이지만 실제는 많이 보내도 매번 번호가 틀려져요.

메세지에는 매번 시도 할때마다 port 번호가 랜덤으로 바뀌어 표시되는되요.

3000 번호 틀리지 않았아요.

그런데 안되네요.

 

3번 보내봄 메세지

E/flutter ( 7352): Error: SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = 127.0.0.1, port = 40382

E/flutter ( 7352): #0 DioMixin.fetch (package:dio/src/dio_mixin.dart:509:7)

E/flutter ( 7352): <asynchronous suspension>

E/flutter ( 7352): #1 LoginScreenState.build.<anonymous closure> (package:middle1order_20240309/user/view/login_screen.dart:84:34)

E/flutter ( 7352): <asynchronous suspension>

E/flutter ( 7352):

E/flutter ( 7352): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: DioException [connection error]: The connection errored: Connection refused This indicates an error which most likely cannot be solved by the library.

E/flutter ( 7352): Error: SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = 127.0.0.1, port = 50358

E/flutter ( 7352): #0 DioMixin.fetch (package:dio/src/dio_mixin.dart:509:7)

E/flutter ( 7352): <asynchronous suspension>

E/flutter ( 7352): #1 LoginScreenState.build.<anonymous closure> (package:middle1order_20240309/user/view/login_screen.dart:84:34)

E/flutter ( 7352): <asynchronous suspension>

E/flutter ( 7352):

D/EGL_emulation( 7352): app_time_stats: avg=273.88ms min=12.87ms max=5251.89ms count=21

D/EGL_emulation( 7352): app_time_stats: avg=377.77ms min=12.58ms max=8686.61ms count=24

E/flutter ( 7352): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: DioException [connection error]: The connection errored: Connection refused This indicates an error which most likely cannot be solved by the library.

E/flutter ( 7352): Error: SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = 127.0.0.1, port = 35280

E/flutter ( 7352): #0 DioMixin.fetch (package:dio/src/dio_mixin.dart:509:7)

E/flutter ( 7352): <asynchronous suspension>

E/flutter ( 7352): #1 LoginScreenState.build.<anonymous closure> (package:middle1order_20240309/user/view/login_screen.dart:84:34)

E/flutter ( 7352): <asynchronous suspension>

E/flutter ( 7352):

 

codefactory님의 프로필 이미지
codefactory
Instructor

안녕하세요! 혹시 Dio 버전 똑같이 맞춰주셨나요? 그런데도 문제가 있다면 저희 카카오 채널에서 원격 신청 부탁드립니다.

https://links.codefactory.ai

cdway's profile image
cdway

asked

Ask a question