Activity Popup crashes app if canceling a Tweet / Email / Etc

Hi,

When I use the Activity Popup to share and select any option (Twitter, Email, Whatsapp, Notes, etc):

  • If I submit the message, it is shared (on Twitter/Whatsapp/etc), then I close the share window and my app works fine.
  • But, if I cancel the message and I close the share window, my app crashes every single time.

I’m using Version 2020.3582 (2020.4.19) I have iOS 13.5. I tested in 3 iPhones and 1 iPad and happens the same.

My code for sharing is:

local itemsToShare = {
{ type = “image”, value = { filename = theImagePath, baseDir = system.ResourceDirectory } },
{ type = “string”, value = hashtag },
{ type = “url”, value = urltag },
}
local options = { items=itemsToShare, listener=popupListener }
native.showPopup( “activity”, options )

Anybody knows what could be happening?

Thanks!

Jorge

First, Great post. You included many great details.

Second, It sounds like we may benefit from seeing the log. You can get this by tethering a device to your Mac and then opening the xCode console window for that device.

(I may be messing up the terms and I don’t have a Mac running right now, but as I recall this was under the Windows menu I believe. Then you had to enable the device for debug. )

Please check back if you can get the log view working. If not, I hope one of my cohorts with a Mac can better remember the steps.

1 Like

Thank you! I just tried with an older build (3579), but I still get the same error.

This is what the console shows for my app (Blobbies)

BEFORE I closed the share popup, I got a few of these errors:

error 21:31:52.452277-0500 kernel Sandbox: Blobbies(3810) deny(2) file-test-existence /bin/bash
error 21:31:52.452308-0500 kernel Sandbox: Blobbies(3810) deny(2) file-test-existence /private/etc/apt
error 21:31:52.452336-0500 kernel Sandbox: Blobbies(3810) deny(2) file-test-existence /bin/sh
error 21:31:52.989550-0500 Blobbies nehelper sent invalid result code [1] for Wi-Fi information request
error 21:31:52.990166-0500 Blobbies nehelper sent invalid result code [1] for Wi-Fi information request

error 21:31:54.555438-0500 SpringBoard [_UIKeyboardArbiter] Rejecting attach for <_UIKeyboardArbiterHandle: 0x280758be0; PID 3810: com.pers.blobbies sceneID:com.pers.blobbies-default; hosting PIDs {(
3840
)}; level 0.000000; active NO [wants YES]; suppression 0; iav 0.000000> (currently (null))
error 21:31:55.457355-0500 SpringBoard [_UIKeyboardArbiter] Rejecting attach for <_UIKeyboardArbiterHandle: 0x280758be0; PID 3810: com.pers.blobbies sceneID:com.pers.blobbies-default; hosting PIDs {(
3840
)}; level 3.000000; active NO [wants YES]; suppression 0; iav 0.000000> (currently (null))

not sure if they mean anything.

AFTER I cancelled a tweet, discarded and then closed the Share popup I got this (I’m uploading it as an attachment since this is quite long): log.txt (93.8 KB)

That’s when it crashes.

Thanks again!

Calling all iOS debuggers. Please take a look and help out if you can.

Meanwhile,

First Idea

I’m not sure if this is valid any more, or if it will help, but I wonder if the app is thinking you suspended and then exiting.

There used to be a builds.settings field to disable exit on suspend.
settings =
{
orientation =
{
default = “portait”,
supported =
{
“portrait”
}
},
iphone = {
plist = {
UIApplicationExitsOnSuspend = false,
},
}
}

Second Idea
I see this message in the log Failed to find a beta app with bundleID: com.pers.blobbies.
Question: Is your bundle ID specified correctly? i.e. You did not (and should not) specify it in the iphone->plist. It will get this value from the provisioning profile.

This is probably correct. I’m just grasping here. I do most of my dev on Android and save iOS for last.

Third Idea
Can you put some easy to find log messaging in the code that launches the dialog and any code that acts after you close the dialog? That way you can see if the game started running again or quit before ever getting back in.

You might also go so far as to catch the ‘applicationResume’ event and print a message to see if it restarts and then crashes. https://docs.coronalabs.com/api/event/system/type.html

Fourth Idea

I always like to replicate issues standalone if I can.

I have an old standalone sample that uses the activity Popup here:

Please consider:

  1. Downloading it.
  2. Checking that it matches the current docs settings and usage: https://docs.coronalabs.com/plugin/CoronaProvider_native_popup_activity/index.html
  3. Building it with the same certificate.
  4. Testing to see if you get the same crash.

The app may need a little tweaking but it should be close to what you need to debug/confirm this standalone.

Thank you! :slight_smile:

So here are my results:
First Idea:
Not sure if there is a replacement for “UIApplicationExitsOnSuspend = false,” becasue Apple no longer accepts that parameter. It gives me at error when I try to upload my build if it has that string, so I can’t use it.

ERROR ITMS-90339: “This bundle is invalid. The Info.plist contains an invalid key ‘UIApplicationExitsOnSuspend’ in bundle activityPopup [activityPopup.app]”

Second Idea:
My bundle is correct, but the app is not live yet. Maybe that’s causing the issue?

Third Idea:
Yes, I did add code and I do get a message after I cancel and delete the Tweet:
default 10:53:21.360392-0500 Blobbies (MENSAJE name, type, activity, action): popup activity UIActivityTypePostToTwitter cancelled

But the error happens when I close the share sheet and I don’t get anything from the app at that point, just this:

default 10:54:09.091921-0500 Blobbies Cleanup activity (success=NO, error=(null))
default 10:54:09.092017-0500 Blobbies UIAVC: view will disappear
default 10:54:09.619961-0500 Blobbies UIAVC: view did disappear
default 10:54:09.620105-0500 Blobbies Invalidating slot manager
error 10:54:09.620255-0500 Blobbies connection invalidated
default 10:54:09.623485-0500 sharingd Connection com.pers.blobbies(4169) invalidated
default 10:54:09.623572-0500 backboardd Connection removed: IOHIDEventSystemConnection uuid:9C5B6543-39BA-4CFE-90A9-A9ED198B044A pid:4169 process:Blobbies type:Passive entitlements:0x0 caller:BackBoardServices: + 364 attributes:{
HighFrequency = 1;
bundleID = “com.pers.blobbies”;
pid = 4169;
} state:0x1 events:235 mask:0x800
default 10:54:09.624124-0500 SpringBoard [application<com.pers.blobbies>:4169] Now flagged as pending exit for reason: workspace client connection invalidated
default 10:54:09.624771-0500 SpringBoard [FBInterfaceOrientationServiceServer] Removing client application<com.pers.blobbies>:4169.
default 10:54:09.624850-0500 SpringBoard Removed client for observing orientation events: <FBServiceFacilityServerClientHandle: 0x2826380c0; com.apple.frontboardservices.orientation-observer; application<com.pers.blobbies>:4169: remote>

Fourth Idea:
I used your code (but I had to remove UIApplicationExitsOnSuspend and add app icons, otherwise it would not let me upload) and it also crashed!

So, it’s not my code. Maybe the removal of UIApplicationExitsOnSuspend is causing the error? Or maybe the fact that my app is not live?

@Pers - Thanks for following up on those steps. I am currently without a working OS X build system, so I can’t test on my devices over here.

I suspect this is some compatibility issue between the way the activity popup code is implemented and some changes in newer versions of iOS. This feature is pretty old and I don’t know the history of its maintenance (in Corona/Solar2D). I do know that the way it is implemented on various devices has changed over time.

It will take me a while to get my OS X dev system working again. So, I hope that anyone reading this who has insights will weigh in.

Thanks @roaminggamer.
If I find out anything else, I’l post it here.

1 Like

I’m getting the same error. Do you find any solution to this @Pers?

Are you sure it is just for this? Do me a favor. Launch your app. Lock the phone and wait a few seconds then unlock it. You can also try it by putting the app in the background for a few seconds then trying it to bring it back. You should see something like this in the logs:

error 10:54:09.620255-0500 name of app connection invalidated

No, I could never fix it @LigiaMontejo

@agramonte, I tried what you said, but my app keeps working.
The error is only on sharing/canceling and what I could find out is that it is an OS issue with Solar2D (and also others).

Thank you!

I can confirm this bug. It has been around for quite some time. I reported it to the corona labs team approximately one and a half year ago.

After going open source, it would be a better idea to report it again through GitHub. I don’t know which one is more appropriate but you can create an issue on Activity Popup repository or the main repository.

I am having the same problem here with build 2021.3637

When user starts an action inside activity window (like sharing to Facebook) and cancels, the window crashes and closes the app.

If the user continues to post to Facebook for example it does work properly and returns the app.

Another problem I am having is if I try to share an image through the activity window and choose action text message, I am not able to send the message and also the layout of the text message display has visual bugs like the text field displaying over text history and the image being inserted is cut off by the text field only being one row high.

I do not see any issues listed in the Activity Popup plugin so I will list these there, but most likely this plugin is too buggy to use confidently in my app without users reporting these bugs to me.