我正在为自己构建一些内部工具,以使用已设置的某些模板以及可以在应用之间共享的一些其他功能来生成Flutter应用。
此刻,代码可以编译,良好构建和部署,但会卡在第一个视图(黑屏)上,并在失败前重试11次以启动Observatory服务器。除了下面的错误之外,没有其他错误。
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Built build\app\outputs\apk\debug\app-debug.apk.
I/flutter ( 7011): Observatory server failed to start after 1 tries
I/flutter ( 7011): Observatory server failed to start after 2 tries
I/flutter ( 7011): Observatory server failed to start after 3 tries
I/flutter ( 7011): Observatory server failed to start after 4 tries
I/flutter ( 7011): Observatory server failed to start after 5 tries
I/flutter ( 7011): Observatory server failed to start after 6 tries
I/flutter ( 7011): Observatory server failed to start after 7 tries
I/flutter ( 7011): Observatory server failed to start after 8 tries
I/flutter ( 7011): Observatory server failed to start after 9 tries
I/flutter ( 7011): Observatory server failed to start after 10 tries
I/flutter ( 7011): Observatory server failed to start after 11 tries
I/flutter ( 7011): Could not start Observatory HTTP server:
I/flutter ( 7011): SocketException: Failed to create server socket (OS Error: Permission denied, errno = 13), address = 127.0.0.1, port = 0
I/flutter ( 7011): #0 _NativeSocket.bind (dart:io/runtime/bin/socket_patch.dart:591:7)
I/flutter ( 7011): <asynchronous suspension>
I/flutter ( 7011): #1 _RawServerSocket.bind (dart:io/runtime/bin/socket_patch.dart:1206:26)
I/flutter ( 7011): #2 _ServerSocket.bind (dart:io/runtime/bin/socket_patch.dart:1466:29)
I/flutter ( 7011): #3 ServerSocket.bind (dart:io/runtime/bin/socket_patch.dart:1457:26)
I/flutter ( 7011): #4 _HttpServer.bind (dart:_http/http_impl.dart:2520:25)
I/flutter ( 7011): #5 HttpServer.bind (dart:_http/http.dart:227:19)
I/flutter ( 7011): #6 Server.startup.poll (dart:vmservice_io/server.dart:355:36)
I/flutter ( 7011): <asynchronous suspension>
I/flutter ( 7011): #7 Server.startup (dart:vmservice_io/server.dart:367:23)
I/flutter ( 7011): <asynchronous suspension>
I/flutter ( 7011): #8 main (dart:vmservice_io/vmservice_io.dart:253:12)
I/flutter ( 7011):
我的问题是:
代码看起来与我正在处理的模板相同(可以工作),唯一的区别是程序包名称不同。
编辑1
Here是指向挂起以进行复制的项目的链接。
答案 0 :(得分:0)
在Android Manifest文件中添加Internet权限。 我也面临这个问题。添加此权限后,现在可以正常工作。
do{}while()
问题是在调试模式下需要Internet权限。
Android清单文件对此有描述
开发需要INTERNET权限。特别, flutter需要它与正在运行的应用程序进行通信 允许设置断点,提供热重载等。
答案 1 :(得分:0)
检查android / app / src是否应具有调试目录,主目录和配置文件目录。 check image