Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Help please with native.popup.activity runtime error
Started by ammar71 Oct 09 2019 03:14 PM

5 replies to this topic
activity popup runtime error

Best Answer Rob Miracle , 12 October 2019 - 02:33 PM

The problem is in your build.settings file.  You have this:

supportedPlatforms={"iphone"}

when it should be:

supportedPlatforms={iphone = true}

In your version you're creating a table named supportedPlatforms, which is being treated as a numerically indexed array and supportedPlatorms[1] = the string "iphone".  However we are expecting a table that contains key-value pairs that's indexed by the key. In the second version the key is "iphone" and the value is true.

 

Make that change and the activity popup will work exactly as expected.

 

Rob

[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

ammar71

[GLOBAL: userInfoPane.html]
ammar71
  • Enthusiast

  • 55 posts
  • Corona SDK

Hi,

 

I am having a problem with a runtime error on iOS. The error is:

module 'CoronaProvider.native.popup.activity' not found:resource (CoronaProvider.native.popup.activity.lu) does not exist in archive.

In build.settings I have:

plugins =
{
	["CoronaProvider.native.popup.social"] =
	{
		publisherId = "com.coronalabs"
	},
	["CoronaProvider.native.popup.activity"] =
        {
            publisherId = "com.coronalabs",
	    supportedPlatforms={"iphone"}
        },

In my code, in a handleButtonEvent, I have:

if (system.getInfo("environment") == "device") then
	local platformName = system.getInfo("platformName")
	if platformName == "Android" then
		share_on_android()
	else
		share_on_ios()
	end
end

The share_on_ios() function has:

function share_on_ios ()
    local itemsToShare = {
        {
            type = "image",
            value = { filename = "social_media.png", baseDir = system.DocumentsDirectory }
        },
        { type = "url", value = "http://www.gameforkstudio.com" },
    }
    local options = { items=itemsToShare, listener=popupListener }
    local activity = require( "CoronaProvider.native.popup.activity" )
    native.showPopup( "activity", options )
end


 

Is there anything else I need to add to my code to include the popup plugin into the app?

 

Thanks.



[TOPIC: post.html]
#2

ammar71

[GLOBAL: userInfoPane.html]
ammar71
  • Enthusiast

  • 55 posts
  • Corona SDK

Just an update. The app crashes as soon as I call:

local activity = require( "CoronaProvider.native.popup.activity" )

 

Is this the right plugin to share an image on iOS? On Android I am using the "social popup" instead.

Can the "social popup" be used on iOS?

 

Thanks.



[TOPIC: post.html]
#3

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,207 posts
  • Enterprise

The social popup on iOS is for iOS 7 and earlier. It should not be used on modern iOS devices. Activity is the one you should be using. 

 

Can you make a .zip file with your build.settings, config.lua and main.lua and a simple button to show the popup and share it here?  You probably should upload the .zip file to some place like Dropbox or Google Drive and share it to get a URL and post the URL here.

 

Rob



[TOPIC: post.html]
#4

ammar71

[GLOBAL: userInfoPane.html]
ammar71
  • Enthusiast

  • 55 posts
  • Corona SDK

Hi Rob,

 

Thanks for the reply.

As requested, a zip file with a simple app was created. It shows an image of a cat. When you click on the cat, it should share the image but instead I get a crash.

https://1drv.ms/u/s!AsobMPtnfQiBj2a19EOjUa7Yk5mK?e=g3GK0q

 

I am sure it is something stupid I am doing. Unfortunately I don't have the experience to pinpoint it  :(

(Hope I shared the file correctly and that you can access it).



[TOPIC: post.html]
#5

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,207 posts
  • Enterprise

  Best Answer

The problem is in your build.settings file.  You have this:

supportedPlatforms={"iphone"}

when it should be:

supportedPlatforms={iphone = true}

In your version you're creating a table named supportedPlatforms, which is being treated as a numerically indexed array and supportedPlatorms[1] = the string "iphone".  However we are expecting a table that contains key-value pairs that's indexed by the key. In the second version the key is "iphone" and the value is true.

 

Make that change and the activity popup will work exactly as expected.

 

Rob


  • ammar71 likes this

[TOPIC: post.html]
#6

ammar71

[GLOBAL: userInfoPane.html]
ammar71
  • Enthusiast

  • 55 posts
  • Corona SDK

Thanks Rob. It worked  :)




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: activity popup, runtime error