Unity in-app purchase not working on android device ?

Hi i just added UNITY IAP in my project. In play mode everything is working fine and purchase method called. But when i run the app on my android device i didn’t see google purchase pop dialog. I haven’t publish the app in beta testing yet but at least you can get the google purchase pop up with error.

so when i call the purchase method on android phone , nothing happens . Please help me .

1 Like

You need to publish to Google Alpha/Beta test, and use a tester account (not your developer account). You will first need to download the app from the store to begin testing, then subsequently you can side load the app. There is more information here Unity - Manual: Configuring for Google Play Store

Hi may I ask, because I use different plugin for IAP before. then I updated to 2018 unity then I use the IAP services.
but when I tried in mobile it doesnt work. my first IAP plugin work. is it maybe I didnt upload the new one? with new IAP services. does that connect at all?

thanks

@tataygames We would need more information such as the device logs. I would recommend that you build with 1.20.1 following the directions here: IAP Troubleshooting - Remove and Reinstall Unity IAP

@JeffDUnity3D Hi thank you for your reply I will double check my implementation.

BTW, maybe you can answer this topic which is really troubling in deploying to android.

https://answers.unity.com/questions/1573076/unity-20182-so-many-unsupported-devices-on-android.html

Hey I am troubles with my IAP buttons.

I updated my Unity to the latest as well as the IAP catalogue. On IOS it works fine but on android it doesn’t function well and the Purchase buttons have shifted.

I tried on my own android device and only the last 2 buttons work but they have the information of the previous two.
I have tried recreating my IAP buttons and deleting my googleplay services plugins as well.

I have no errors in my Unity compiler or Android SDK.

Do you know what the problem could be?


I am having the same problem but my app has been fully published and released. I released it without the IAP due to I didn’t want to miss my release date and then did an update a couple days later with the IAP active. It works perfect when testing in play mode but after publishing, the purchase button does nothing, like the button has no function at all. I’ve verified on friends devices and Google accounts to be sure it wasn’t just an issue with being logged in under the same email as the developer.

Also my IAP is set up correctly and everythingbut it isn’t showing any dialogue window when i press on my buttons. Please tell me there is a fix coming or someone has a solution!

Please provide device logs and specific steps to reproduce. Make sure you have followed the steps here Unity - Manual: Configuring for Google Play Store . More information on capturing device logs here How To - Capturing Device Logs on Android

Hi i have the same issue.
I’m using Unity 2019.2.11f
I have tried accessing the IAP using codeless IAP and from script, the current project uses codeless IAP.
Attached is my log file.
A heads up, i use powershell to make the log file since i somehow can’t redirect command prompt, and i have to kill the adb process via another window of powershell, just confused because the log file is small.

Thanks

5961536–639176–log.txt (3.09 KB)

i am stuck with same problem. i am using unity 2018.4.3. i delete the plugin and import again from unity services window and my game is already published with iap on play store but it is working on unity engine but not on android device

Please provide the device logs. They will tell what is wrong.

  • Connect your device via USB
  • Open a command prompt window
  • Confirm that “adb devices” sees your device
  • Run “adb logcat | grep -i unity > out.txt” (use findstr on Windows)
  • Run your game, and attempt a purchase
  • Back in the command prompt, press Ctrl+c to end the capture.
  • Review the logs, looking for “unityiap”
  • Attach here with your observations

[Alpha test already published and testing on a phone]
I did that , and i have logs file attached.

i have 2 problems :
1- IAP is not working , i can’t understand why from the logs.
2-unity ads aren’t working either , it says in the log that “Unity Ads show failed: Unity Ads is not initialized”.
in unity ads , i have this Advertisement.Initialize(Googleid, testMode);
testMode is set to false. is this wrong for alpha testing ?

6168932–675002–log.txt (35.6 KB)

@ragyhassan22 I see the issue in your logs, thank you for providing. When you install IAP it asks you if you want to Update your API with “Yes, I have made a backup”. You must do this or IAP will not install correctly. I see the tell-tale VRSettings::get_enabled exception. I would recommend that you upgrade to IAP 1.23.4 and ensure you say “Yes” to this prompt. I would not be able to assist with your ads issue, you would need to post in the Ads forum. But you are getting the error “no static method with name=‘addListener’” so be sure to post your code there Unity Services - Unity Discussions

Thank you so much.

so i tried to reimport IAP , and it didn’t ask me to update my API .
i attached a new logs file and an image for the IAP says that its up to date.

6169430–675116–log.txt (29.6 KB)
6169430--675119--IAP.PNG

What version were you using previously? Is the same error in the logs? Then you’ll need to remove IAP altogether and reinstall it. You may need to start with a recent backup.

I believe i was using IAP 1.23.4
i tried to remove IAP and kept getting a lot of errors , even though after solving these errors and reinstalling IAP , the update your API window never appeared.
so i created a totally new empty project with a different unity ID and installed IAP but the window didn’t also.

should i uninstall unity w reinstall it again ?

i fixed it thank god.
i was using unity 2019.1.2f1 so i upgraded it to unity 2019.4.6f1 and reimport IAP and it worked.

Not working for me, Using 2021.3. Game just crashes upon pressing the IAP button.