Question

My Flutter app crashed when get offerings

  • 5 May 2023
  • 3 replies
  • 45 views

Badge

My Flutter app crashed when get offerings. I use purchases_flutter: ^4.11.1

Error:

My Code;

 


3 replies

Badge

any help ?

Userlevel 6
Badge +8

Hey @sergen-c5d636!

Can you run `flutter doctor` and provide the output?

Userlevel 3
Badge +5

@sergen-c5d636 Hey! 👋 

This is rather suspicious looking with the line in your stacktrace that says… 

java. lang. IncompatibleClassChangeError: Found interface com.revenuecat.purchases.models.StoreProduct, but class was expected.

 

In Purchases Flutter v4, `com.revenuecat.purchases.models.StoreProduct` is a class but in Purchases Flutter v5 (which is in beta) it is an interface.

Did you happen to try out a beta version of Purchases lately? This error makes it seem like there could be an issue in some gradle/build cache where that is causing this confusion 🤔 

The solution for you here might be to clean out some of your caches. There are always so many ways to do this and I’m not exactly sure which one of these would do it for you but you could:

  • Run `flutter clean`
  • Run `gralde clean` (or something similar)
  • Go into Android Studio > File > Invalidate Caches…

Hopefully one of these should work for you and prevent this class/interface issue from happening!

Reply