Error connecting to the service protocol failed to connect to错误

496 阅读1分钟

本文已参与「新人创作礼」活动,一起开启掘金创作之路。

问题描述

使用oppo手机debug Flutter Android应用时报错。报错内容如下:

Error connecting to the service protocol: failed to connect to http://127.0.0.1:57455/toyCz5p8HME=/

导致用OPP R9 手机调试flutter APP时,不能热加载;报错如下图:

image.png

问题原因

PC和手机未处于同一个局域网内

解决方法:

将手机和PC连接同一个网络

处于同一网络后报错消失


Running Gradle task 'assembleDebug'...

√ Built build\app\outputs\flutter-apk\app-debug.apk.

Debug service listening on ws://127.0.0.1:62952/fPjCh0ggFxA=/ws

Syncing files to device OPPO R9tm...

I/SurfaceView( 4300): Punch a hole(dispatchDraw), w = 1080, h = 1920, this = io.flutter.embedding.android.FlutterSurfaceView{33c2fbae V.E..... ........ 0,0-1080,1920}

W/MALI ( 4300): glDrawArrays:714: [MALI] glDrawArrays takes more than 5ms here. Total elapse time(us): 8505

D/OpenGLRenderer( 4300): ProgramCache save to disk, size = 2

image.png