Unity IAP error on 2.1.1(purchase failed because purchasing was not initialized correctly)

I completed the setup as described in the document below.
[Google Play Store Setup, IAP Setting]
However, when I click the buy button after building Android, the message “purchase failed because purchasing was not initialized correctly” appears.

More details from here.
When I run it in the Unity editor, a fake shop appears.
However, if I register the alpha test with Google after build or run it immediately, the message “purchase failed because purchasing was not initialized correctly” will appear.
This error causes the same error for both codeless IAP and manual IAP.
After debugging, I can see that “UnityPurchasing.Initialize (this, builder)” is called,
The “OnInitialized (IStoreController controller, IExtensionProvider extensions)” callback function is not called.
I would like to know how to fix this error.

6469319--725987--1.PNG



What Android device are you testing on? IAP requires devices that have Google Play installed. I might suggest you start with the Sample IAP Project here Sample IAP Project

I tested it with a samsung galaxy note 9.
And I downloaded it from Google Play as an alpha test.

So you’re loading the fake store so you are aware, did you create your own app? Did you compare to the Sample IAP Project? Please share your code.

1 Like

I uploaded it to the Google Play Store using codeless and it works normally.
Thank you!

hmm. Iam having the same issue , the problem is have upload the app officially. and create the products on the CHplay console, when i download it from the CH play and use the logcat to debug it said “purchase failed because purchasing was not initialized correctly”. and this project(let call it game A) is the one i clone from my previous game(let call it game B), just change the character and back ground. but the codeless IAP works in B but not in A. Iam using unity 2021.1.1.15
and the latest IAP

Sorry, what is the CHplay console? What is different between A and B in your scenario?

CHplay console is this one. And A and B are the same just different in some picture and game icon. The logic are the same
7349462--894218--upload_2021-7-22_0-15-24.png

So you mean Google Play console. And A and B are separate Apps on the Google console? This one is called Angle Flap, what is the other called? Please contact me privately and I can provide my email address so you can add me to Closed testing for both of these games, I will take a look too.