API 在模拟器上工作,但现在在真实设备上工作 (phone)。扑

APIs working on emulator but now working on real device (phone). flutter

我是 Flutter 的新手,我正在创建一个 Flutter 应用程序,我在其中使用不同的 APIs(第三方 APIs)。 虽然 运行 模拟器上的应用程序运行良好,但当我为其生成 APK 并将其安装到我的 phone 时,它无法运行。 所有的设计和布局都非常完美,但是当我要点击登录时 API,没有任何效果。

提前致谢。

对于发布版本,您必须在位于 my_flutter_project/android/app/src/main/.

AndroidManifest.xml 文件中添加互联网权限
<uses-permission android:name="android.permission.INTERNET" />

<application
        android:name="io.flutter.app.FlutterApplication"
        ...