Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Runtime Error - module 'plugin.google.iap.v3' not found
Started by info2302 Jan 09 2020 03:28 AM

2 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

info2302

[GLOBAL: userInfoPane.html]
info2302
  • Observer

  • 2 posts
  • Corona SDK

I'm currently trying to get an In-App Subscription working, and I've got it set up perfectly fine for iOS, but on a Huawei device running Android I'm getting this error as soon as the app is launched:

Runtime Error
module 'plugin.google.iap.v3' not found: resource(plugin.google.iap.v3.lu) does not exist in archive
no field
package.preload['plugin.google.iap.v3']
no file '(null)/plugin/google/iap/v3.lua'
no file '(null)/plugin/google/iap/v3.lua'
no file '/data/app/com.bundle.id/lib/arm64/libplugin/google/iap/v3.so'
no file './plugin/google/iap/v3.so'
no file '(null)/plugin/google/iap/v3.so'
no file '/data/app/com.bundle.id/lib/arm64/libplugin.so'
no file './plugin.so'
no file '(null)/plugin.so'

I'm loading my products as follows:

local store

targetAppStore = system.getInfo("targetAppStore")

if ("apple" == targetAppStore) then  -- iOS
    store = require("store")
elseif ("google" == targetAppStore) then  -- Android
    store = require("plugin.google.iap.v3")
else
    print("In-app purchases are not available for this platform.")
end


function transactionListener(event)
    local transaction = event.transaction

    print(transaction.isError)
    print(transaction.state)
    print(transaction.productIdentifier)
    print(transaction.date)
 
    if (transaction.isError) then
        print(transaction.errorType)
        print(transaction.errorString)
    else
        -- No errors; proceed
        if ( transaction.state == "purchased" or transaction.state == "restored" ) then
            -- Handle a normal purchase or restored purchase here
        elseif ( transaction.state == "cancelled" ) then
            -- Handle a cancelled transaction here
        elseif ( transaction.state == "failed" ) then
            -- Handle a failed transaction here
        end
 
        -- Tell the store that the transaction is complete
        store.finishTransaction(transaction)
    end
end


-- Initialize store
if store ~= nil then
    store.init(transactionListener)
end


productIdentifiers = {
    "my_identifier",
}


local function productListener(event)
    for i = 1,#event.products do
        print(event.products[i].productIdentifier)
    end

    store.purchase("my_identifier")
end


store.loadProducts(productIdentifiers, productListener) 

My build settings:

--
-- For more information on build.settings, see the Project Build Settings guide at:
-- https://docs.coronalabs.com/guide/distribution/buildSettings
--

settings =
{
	orientation =
	{
		-- Supported values for orientation:
		-- portrait, portraitUpsideDown, landscapeLeft, landscapeRight
		default = "portrait",
		supported = { "portrait", },
	},

	--
	-- Android section
	--
	android =
	{
		usesPermissions =
		{
			"android.permission.INTERNET",
			"com.android.vending.BILLING",
		},
	},

	--
	-- iOS section
	--
	iphone =
	{
		xcassets = "Images.xcassets",
		plist =
		{
			UIStatusBarHidden = false,
			UILaunchStoryboardName = "LaunchScreen",
			NSAppTransportSecurity =
            {
 				NSAllowsArbitraryLoads = true,
            },
            NSCameraUsageDescription = "Used to scan barcodes"
		},
	},

	--
	-- Plugins section
	--
	plugins =
	{
		['plugin.qrscanner'] = {
			publisherId = 'com.spiralcodestudio'
		}
	},

	--
	-- Project section
	--
	excludeFiles =
	{
		-- Exclude unnecessary files for each platform
		all = { "Icon.png", "Icon-*dpi.png", "Images.xcassets", },
		android = { "LaunchScreen.storyboardc", },
	},

	splashScreen = 
    {
        enable = false
    },
}

Any help as to why I'm getting this issue would be great. I have just read on the forums about the store.init() being asynchronous for Google Play so I'm looking into that and if that would cause my issue, but I'd love any clarification on anything I'm missing here.



[TOPIC: post.html]
#2

pixec

[GLOBAL: userInfoPane.html]
pixec
  • Contributor

  • 218 posts
  • Corona SDK

How about you add the plugin to the plugins in yer build settings? :D then it might be found

[TOPIC: post.html]
#3

info2302

[GLOBAL: userInfoPane.html]
info2302
  • Observer

  • 2 posts
  • Corona SDK

Yeah I completely missed that stage out and noticed before the question even got approved. That was the issue and it's fixed now, thank you.




[topic_controls]
[/topic_controls]