【问题标题】:Flutter Square Plugin crashes in release onlyFlutter Square 插件仅在发布时崩溃
【发布时间】:2020-06-24 05:10:40
【问题描述】:

Flutter Square 插件仅在我使用无效卡或按下返回时才会在发布时崩溃。 但是当我使用 flutter run --release 并连接我的手机时。不会发生崩溃,并且该应用程序运行良好!

这是我们使用的代码

  void _pay() async {
await InAppPayments.setSquareApplicationId(sqAppId);
try {
  await InAppPayments.startCardEntryFlowWithBuyerVerification(
      money: Money((money) => money
        ..amount = 0
        ..currencyCode = 'USD'),
      collectPostalCode: true,
      contact: Contact((ContactBuilder contact) {
        return contact.givenName = username;
      }),
      buyerAction: "Store",
      squareLocationId: sqLocationId,
      onBuyerVerificationSuccess: (BuyerVerificationDetails result) {
        addCard(result.nonce, result.card.postalCode);
      },
      onBuyerVerificationFailure: (err) {
        return showErrorDialog(context, err.toString());
      },
      onCardEntryCancel: () {});
} on Exception catch (e) {
  print(e);
}

}

flutter build 和 flutter run --release 有什么区别? 我可以从flutter run中使用APK并将其上传到google play吗?

【问题讨论】:

    标签: flutter square


    【解决方案1】:

    在发布版本中,您必须明确添加权限。 尝试将 android.permission.INTERNET 添加到 Manifest 文件中。 添加 <uses-permission android:name="android.permission.INTERNET"/> 到位于android/app/src/mainAndroidManifest.xml

    关于上传可调试 apk 的问题,Google Play-Upload 将拒绝您的文件。

    请参阅此link 了解发布和调试之间的区别。

    【讨论】:

      猜你喜欢
      • 2020-09-27
      • 2020-02-09
      • 2021-01-22
      • 1970-01-01
      • 2020-04-04
      • 2021-07-17
      • 2019-06-06
      • 2019-08-15
      • 2011-10-03
      相关资源
      最近更新 更多