adaptyteam / AdaptySDK-Flutter

SDK for growing mobile in-app purchases
https://docs.adapty.io/docs/quickstart
MIT License
95 stars 17 forks source link

Android Adapty.makePurchase() does not return #41

Closed lcuis closed 2 years ago

lcuis commented 2 years ago

Hello,

My sandbox Flutter app in-app purchases work fine with Adapty on iOS but on Android, the Adapty.makePurchase() call never returns on the following device: Xiaomi Redmi Note 10 Android 11

Here is my doctor:

flutter doctor -v
[✓] Flutter (Channel stable, 2.5.3, on macOS 12.1 21C52 darwin-arm, locale en-CH)
    • Flutter version 2.5.3 at /Users/XXX/FlutterDev/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 18116933e7 (4 months ago), 2021-10-15 10:46:35 -0700
    • Engine revision d3ea636dc5
    • Dart version 2.14.4

[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
    • Android SDK at /Users/XXX/Library/Android/sdk
    • Platform android-32, build-tools 32.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 13.2.1, Build version 13C100
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] Connected device (2 available)
    • Chrome (web)      • chrome      • web-javascript • Google Chrome 98.0.4758.102

• No issues found!

Here are the logs I get before the app hangs on Adapty.makePurchase():

I/[Adapty 0.9.3 93](29412): 2022-02-19 21:50:35.166+0100  - Response success 5 - INFO
I/[Adapty 0.9.3 93](29412): 2022-02-19 21:50:39.375+0100  - Response https://kinesis.us-east-1.amazonaws.com/: {"FailedRecordCount":0,"Records":[{"SequenceNumber":"49612976497545499553447725026730722812664153682028265522","ShardId":"shardId-000000000003"}]}
I/[Adapty 0.9.3 93](29412):  - INFO

However, I was able to purchase with the following device but only once: Samsung A037F Android 11

After the first attempt and subscription cancellation from the play store, the device gets the same problem: Adapty.makePurchase() doesn't return.

vladd-g commented 2 years ago

Hi! According to the logs provided, you’re using an old version of the SDK, could you please update to the latest one? For now it's 1.0.9

lcuis commented 2 years ago

Thanks @vladd-g ,

I'm looking forward to trying an upgrade.

lcuis commented 2 years ago

Indeed, I was using adapty_flutter: 0.3.4 and using version 1.0.9 allowed me to purchase again.

Thanks!