gpt4 book ai didi

android - Flutter 应用程序无法以 Debug模式启动

转载 作者:IT王子 更新时间:2023-10-29 06:37:39 25 4
gpt4 key购买 nike

我有一个带有调试配置的简单 Flutter 应用程序。在我更改 gradle 配置和其他内容以在 Release模式下构建 apk 之后。我根据文档完成了所有配置,发布构建工作正常。但是现在我无法在 Debug模式下运行应用程序。它显示此错误

I/flutter (15809): Observatory server failed to start after 11 tries
I/flutter (15809): Could not start Observatory HTTP server:
I/flutter (15809): SocketException: Failed to create server socket (OS Error: Permission denied, errno = 13), address = 127.0.0.1, port = 0
I/flutter (15809): #0 _NativeSocket.bind (dart:io/runtime/binsocket_patch.dart:545:7)
I/flutter (15809): <asynchronous suspension>
I/flutter (15809): #1 _RawServerSocket.bind (dart:io/runtime/binsocket_patch.dart:1138:10)
I/flutter (15809): #2 _ServerSocket.bind (dart:io/runtime/binsocket_patch.dart:1385:10)
I/flutter (15809): #3 ServerSocket.bind (dart:io/runtime/binsocket_patch.dart:1375:26)
I/flutter (15809): #4 _HttpServer.bind (dart:_http/http_impl.dart:2503:10)
I/flutter (15809): #5 HttpServer.bind (dart:_http:276:19)
I/flutter (15809): #6 Server.startup.poll (dart:vmservice_io/server.dart:352:36)
I/flutter (15809): <asynchronous suspension>
I/flutter (15809): #7 Server.startup (dart:vmservice_io/server.dart:364:23)
I/flutter (15809): <asynchronous suspension>
I/flutter (15809): #8 main (dart:vmservice_io:239:12)
I/flutter (15809):

它显示白屏且未加载任何内容。

最佳答案

在构建发布版本时,它说如果应用程序不需要互联网权限,则删除它。但是当我们进行开发时,我们必须保留它。因为需要互联网许可才能进行热重载。添加后

 <uses-permission android:name="android.permission.INTERNET"/>

对于 list ,一切正常

关于android - Flutter 应用程序无法以 Debug模式启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51751873/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com