반응형
Installing build/app/outputs/flutter-apk/app.apk...
I/flutter (12330): Could not start Dart VM service HTTP server:
I/flutter (12330): SocketException: Failed to create server socket (OS Error: Operation not permitted, errno = 1), address = 127.0.0.1, port = 0
I/flutter (12330): #0 _NativeSocket.bind (dart:io-patch/socket_patch.dart:996:7)
I/flutter (12330): <asynchronous suspension>
I/flutter (12330): #1 Server.startup.startServer (dart:vmservice_io/vmservice_server.dart:414:19)
I/flutter (12330): <asynchronous suspension>
I/flutter (12330): #2 Server.startup (dart:vmservice_io/vmservice_server.dart:433:11)
I/flutter (12330): <asynchronous suspension>
위 에러를 겪은 과정이 참 어이가 없다.
윈도우에서 작업하던 프로젝트를 깃으로 올려 맥북으로 받았는데 저런에러가 뜨는것이였다.
다른 환경이라 생긴 에러인줄 알고 삽질했었는데 알고보니 깃으로 주고받는 과정에서 생긴 이슈였다.
나같이 멍청한 실수를 한사람이 없는지 구글링해도 자료가 하나도 안나왔다 ㅋㅋ 몇시간을 삽질..
android/app/src경로 폴더 안에 원래는 프로젝트 생성시 main, profile, debug폴더가 있어야 된다.
그런데 공부하기 전용 레포에 flutter 프로젝트들을 넣어놨는데 그것이 화근이였다.
레포 최상단에 .gitignore에 debug 폴더를 제외하는 규칙(에러 원인!)이 들어가 있었기 때문이다. 따라서 debug폴더가 없어지며
프로젝트 실행시 debug폴더 안에 있는 AndroidManifest.xml이 없어, 인터넷 권한을 줄 수 없어 에뮬레이터와 연결이 안되어 Dart VM service http serror가 생긴것이다. 처음에는 인터넷 권한 문제인거 같아서 android/app/src/main/AndroidManifest.xml에 인터넷 권한 확인도 하고 그랬는데 기본적으로 들어가 있었다... 여기 권한 있으면 debug에 권한 없어도 되야 하는거 아닌가 싶은데.. 참 슬프다.
해결법
올바른 경로에 debug폴더와 AndroidManifest.xml파일을 작성한다.
AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.todogeather.todogeather">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
반응형
'Flutter' 카테고리의 다른 글
dartpad에서 bitwise not, 비트연산자 not 동작이 이상한이유 (0) | 2022.10.26 |
---|---|
flutter MaterialApp을 활용하여 앱 요소 설정하기 (0) | 2022.10.26 |