IAP has been removed from core

Hello,
I’m trying to integrate IAP using the extension.
The iap global instance seems to be present, but when I try to call the buy() method, I get the following error:

iap has been removed from core, please read /builtins/docs/iap.md for more information

I did follow the steps on https://defold.com/extension-iap/ so I’m confused and don’t find a fix.

Thanks for your help

Ok, you’ve added a link to a zip file in the dependencies?

Do you see a extension-iap folder in your project view to the left in the editor?
If not, you need to run “Fetch libraries” from the menu: "Project " -> “Fetch Libraries”
(It is done automatically when opening the editor)

If you already saw that folder, then I’m not sure what would cause this behavior. How do you run the application? What platform?

Yep, added the extension-iap and I see it in my folders:
image
I run the application using dmengine on Android

Ah, this won’t work. The default dmengine.apk which you can download from GitHub and d.defold.com does not include the IAP extension since it has been removed from the engine. You need to run a version of Defold which includes the extension. This is mentioned here:

“The stand-alone version will only work for projects without any native extensions. If your project contains native extensions you must bundle a Debug variant of your project to ensure that the dev app contains the native extensions that you intend to use.”

So bundle your game once using Project->Bundle->Android. Make sure you bundle a debug build. Install and start it. You will now be able to target it and have access to IAPs.

PS: Note this post about bundling issues in 1.2.173: Problem bundling APK/AAB file from editor in 1.2.173

2 Likes

OK thank you.

At the moment building a bundle for Android and HTML5 doesn’t work, I constantly get the error:

I tried many things to fix this (including cleaning /lib folder), but no luck so far. The reports are empty as well. I can’t understand what file is this error referring to. Thanks for your help.

Which version of Defold are you using?

i’m using defold 1.2.173 beta.

Is it working with 1.2.172? Are you using more extensions than IAP?

The problem was from a defective material file that was left in the project. Thanks for your help.