【问题标题】:Flutter app not connecting to PostgreSQL database in release modeFlutter 应用程序未在发布模式下连接到 PostgreSQL 数据库
【发布时间】:2020-07-26 08:59:31
【问题描述】:

我正在用颤振开发一个应用程序,它连接到树莓派中的 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;
  }

我不知道从哪里开始寻找错误或其他东西。关于如何处理这个问题的任何想法?

谢谢。

【问题讨论】:

  • 嗨@morita_06,我正在尝试与您完全相同(将postgresql连接到flutter),请您提供一些指示或有用的链接。谢谢
  • @GraSim 嗨,我的问题与发布版本有关。除此之外,该应用程序可以很好地连接到 PostgreSQL。接受的答案解决了我的问题。如果您方便我给您写一封电子邮件,我可以帮助您。

标签: postgresql flutter


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2020-06-01
    • 1970-01-01
    • 2021-05-20
    • 2020-04-04
    • 2021-02-11
    • 1970-01-01
    • 2021-01-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多