Flatter应用程序未在发布模式下连接到PostgreSQL数据库

Flatter应用程序未在发布模式下连接到PostgreSQL数据库,postgresql,flutter,Postgresql,Flutter,我正在Flitter中开发一个应用程序,它用树莓pi连接到PostgreSQL服务器。在调试模式下一切正常,但当我切换到释放模式时,会收到以下错误消息: PostgreSQLSeverity.error : Attempting to execute query, but connection is not open. 以下是用于帮助解决方案的连接代码: static PostgreSQLConnection openConnection(){ var connection

我正在Flitter中开发一个应用程序,它用树莓pi连接到PostgreSQL服务器。在调试模式下一切正常,但当我切换到释放模式时,会收到以下错误消息:

PostgreSQLSeverity.error : Attempting to execute query, but connection is not open.
以下是用于帮助解决方案的连接代码:

    static PostgreSQLConnection openConnection(){
      var connection = PostgreSQLConnection(ip, port, dbName, username: 'xxxxxxxxx', password: 'xxxxxxxx');
      connection.open();
      return connection;
  }
我不知道从哪里开始寻找错误或其他东西。你知道如何处理这个问题吗


谢谢。

如果您通过Internet连接到服务器,则需要在android中添加Internet权限。查看更多信息。

Hi@morita_06,我正在尝试与您完全相同的操作(将postgresql连接到Flatter),请您提供一些提示或有用的链接。Thanks@GraSim嗨,我的问题与发布版本有关。除此之外,该应用程序与PostgreSQL连接良好。公认的答案解决了我的问题。我可以帮你,如果你方便我给你发电子邮件的话。