Solved

One or more of the arguments provided are invalid on Android

  • 7 March 2023
  • 4 replies
  • 814 views

Badge +1

hello,

 

I am currently developing with flutter.

 

 

All the steps below have been completed and the APK has been uploaded to the Google Play Store and tested in closed testing

 

https://www.revenuecat.com/docs/creating-play-service-credentials#1-link-to-a-google-developer-project

 

The payment screen does not appear and an error occurs.

 

```

e.details: {code: 4, message: One or more of the arguments provided are invalid., readableErrorCode: PurchaseInvalidError, readable_error_code: PurchaseInvalidError, underlyingErrorMessage: There is no current Activity}

```

I've deleted all Google Play Store accounts on my device and added a recreated one to test, but it still doesn't work.However, the acquisition of the package has been confirmed.

I need help. 

 

> purchases_flutter: 4.10.2

icon

Best answer by miyauchi 10 March 2023, 03:17

View original

4 replies

Badge +1
E  [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(4, One or more of the arguments provided are invalid., {code: 4, message: One or more of the arguments provided are invalid., readableErrorCode: PurchaseInvalidError, readable_error_code: PurchaseInvalidError, underlyingErrorMessage: There is no current Activity}, null)
#0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:653)
#1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:296)
<asynchronous suspension>
#2 Purchases._invokeReturningMap (package:purchases_flutter/purchases_flutter.dart:871)
<asynchronous suspension>
#3 Purchases._invokeReturningCustomerInfo (package:purchases_flutter/purchases_flutter.dart:855)
<asynchronous suspension>
#4 Purchases.purchasePackage (package:purchases_flutter/purchases_flutter.dart:300)
<asynchronous suspension>
#5 PurchaseNotifer.executePersionPurchase

 

Userlevel 4
Badge +6

Hey @miyauchi ,

Unfortunately this error is a little vague - just that one or more of the arguments being provided in making the purchase is invalid.  This could be the payment method, something on Google’s side, something with the sandbox account.

I see that you’ve created a ticket with us as well - I’ll respond there so we can continue to troubleshoot and share more information.

Badge +1

This issue has been resolved.

I'm writing code with flutter using add-to-app, but it's because the purchase screen was created with flutterfragment.
I solved it by changing it to flutteractivity.

Badge +1

The same issue 
D/[Purchases] - DEBUG( 7678): ℹ️ Vending Offerings from cache
D/[Purchases] - DEBUG( 7678): 💰 Product change started:  Subscription(productId=chillaxdev_premium, optionId=yearly, productDetails=ProductDetails{jsonString='{"productId":"chillaxdev_premium","type":"subs","title":"Premium Plan (ChillaxCare Dev)","name":"Premium Plan","description":"Premium Plan","localizedIn":["en-GB"],"skuDetailsToken":"AEuhp4KXq9Le04mGW9BWd7ltfdUSBajKOz3-VbxA3u4Ef55XBeXVgqtdGkkbJsyQxZAG","subscriptionOfferDetails":[{"offerIdToken":"AUj\/YhgIjKaPbI4nRZne0gJ+f2jHcLlg2bPG4wofLABdQ\/q77yg6CP4ZINKEEb+rsogwlWa5+aLITYzDiYals4hQb4+XN2HpD956b1LK5kFgTe3mXE\/k","basePlanId":"monthly","pricingPhases":[{"priceAmountMicros":142000000000,"priceCurrencyCode":"VND","formattedPrice":"₫142,000","billingPeriod":"P1M","recurrenceMode":1}],"offerTags":[]},{"offerIdToken":"AUj\/YhiaEy9PNh21uzjRV3FH+MeVEpMi9JXJSOp0r0ii+M11my90fCJbBsXze8jCzDV1iHT\/E77uIdE08vI09siybe55r8h4GXXPL+55k2VLo78=","basePlanId":"yearly","pricingPhases":[{"priceAmountMicros":1400000000000,"priceCurrencyCode":"VND","formattedPrice":"₫1,400,000","billingPeriod":"P1Y","recurrenceMode":1}],"offerTags":[]}]}', parsedJson={"productId":"chillaxdev_premium","type":"subs","title":"Premium Plan (ChillaxCare Dev)","name":"Premium Plan","description":"Premium Plan","localizedIn":["en-GB"],"skuDetailsToken":"AEuhp4KXq9Le04mGW9BWd7ltfdUSBajKOz3-VbxA3u4Ef55XBeXVgqtdGkkbJsyQxZAG","subscriptionOfferDetails":[{"offerIdToken":"AUj\/YhgIjKaPbI4nRZne0gJ+f2jHcLlg2bPG4wofLABdQ\/q77yg6CP4ZINKEEb+rsogwlWa5+aLITYzDiYals4hQb4+XN2HpD956b1LK5kFgTe3mXE\/k","basePlanId":"monthly","pricingPhases":[{"priceAmountMicros":142000000000,"priceCurrencyCode":"VND","formattedPrice":"₫142,000","billingPeriod":"P1M","recurrenceMode":1}],"offerTags":[]},{"offerIdToken":"AUj\/YhiaEy9PNh21uzjRV3FH+MeVEpMi9JXJSOp0r0ii+M11my90fCJbBsXze8jCzDV1iHT\/E77uIdE08vI09siybe55r8h4GXXPL+55k2VLo78=","basePlanId":"yearly","pricingPhases":[{"priceAmountMicros":1400000000000,"priceCurrencyCode":"VND","formattedPrice":"₫1,400,000","billingPeriod":"P1Y","recurrenceMode":1}],"offerTags":[]}]}, productId='chillaxdev_premium', productType='subs', title='Premium Plan (ChillaxCare Dev)', productDetailsToken='AEuhp4KXq9Le04mGW9BWd7ltfdUSBajKOz3-VbxA3u4Ef55XBeXVgqtdGkkbJsyQxZAG', subscriptionOfferDetails=[com.android.billingclient.api.ProductDetails$SubscriptionOfferDetails@92c1f1, com.android.billingclient.api.ProductDetails$SubscriptionOfferDetails@6fa31d6]}, token=AUj/YhiaEy9PNh21uzjRV3FH+MeVEpMi9JXJSOp0r0ii+M11my90fCJbBsXze8jCzDV1iHT/E77uIdE08vI09siybe55r8h4GXXPL+55k2VLo78=)  - offering: premium_plan_offer oldProductId: chillaxdev_premium:monthly googleProrationMode IMMEDIATE_WITHOUT_PRORATION
D/[Purchases] - DEBUG( 7678): ℹ️ Querying Purchase with chillaxdev_premium:monthly and type SUBS
D/[Purchases] - DEBUG( 7678): ℹ️ Checking if cache is stale AppInBackground false
E/[Purchases] - ERROR( 7678): 🤖‼️ PurchasesError(code=PurchaseInvalidError, underlyingErrorMessage=Couldn't find existing purchase for SKU: chillaxdev_premium:monthly, message='One or more of the arguments provided are invalid.')
I/flutter ( 7678): {} {2023-07-08 12:26:18.892000} {SubscriptionHelper} {paymentMultiSubscription: can't make payment PlatformException errorCode PurchasesErrorCode.purchaseInvalidError 4 -> One or more of the arguments provided are invalid.} {LogLevel.INFO}

Reply