Closed aqaddoumi closed 4 years ago
Are you using NatShare 1.2.2? This crash should have been fixed in a previous update.
Yes I'm using NatShare 1.2.2. I don't think it's a specific problem with iPad, I've just tested on my iPhone 7 and it crashes the app but with a different error.
2020-04-22 10:31:10.072269+0300 app[712:204072] [ShareSheet] connection invalidated libc++abi.dylib: terminating with uncaught exception of type Il2CppExceptionWrapper (lldb)
I think it might have to do with the callback
I'm not sure where the problem is but it highly possible that it's with the callback and might send the same result (fail) when you discard after trying to share or after discarding directly.
Hi, I'm running into the same problem.
So, I'm commiting a Sharepayload using an async function (see attached), then share dialog pops up. Then I choose app to share to. Another dialog pops up (see attached) asking some additional data. If option Cancel is pressed or the second dialog is swiped away, the app crashes (see xcode output attached). If Post is pressed, then everything works as it should.
I tried commiting payload without async await, but nothing changes.
This is the function I call:
async void ShareAsync()
{
bool success = false;
if (screenshot != null)
{
success = await new SharePayload().AddImage(screenshot).Commit();
}
else
{
success = await new SharePayload().AddMedia(videoPath).Commit();
}
if (success)
{
Debug.Log("Saved to camera roll");
}
else
{
Debug.Log("Failed to save to camera roll");
}
}
This is the output of Xcode:
2020-04-22 14:37:19.042685+0300 14[2137:1125009] [core] SLRemoteComposeViewController: (this may be harmless) viewServiceDidTerminateWithError: Error Domain=_UIViewServiceErrorDomain Code=1 "(null)" UserInfo={Terminated=disconnect method}
Failed to save to camera roll
MyCompany.TWScripts.<CheckPermissionAndSave>d__13:System.Collections.IEnumerator.get_Current()
System.Threading.ContextCallback:Invoke(Object)
System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
System.Runtime.CompilerServices.MoveNextRunner:Run()
System.Action:Invoke()
System.Threading.ContextCallback:Invoke(Object)
System.Threading.Tasks.AwaitTaskContinuation:RunCallback(ContextCallback, Object, Task&)
System.Threading.Tasks.Task:FinishContinuations()
System.Threading.Tasks.Task`1:TrySetResult(TResult)
System.Threading.Tasks.TaskCompletionSource`1:TrySetResult(TResult)
System.Threading.Tasks.TaskCompletionSource`1:SetResult(TResult)
NatSuite.Sharing.Internal.NativePayload:OnCompletion(IntPtr, Boolean)
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)2020-04-22 14:37:27.014630+0300 14[2137:1125556] [ShareSheet] connection invalidated
libc++abi.dylib: terminating with uncaught exception of type Il2CppExceptionWrapper
(lldb)
The screenshot mentioned befor (don't mind the officer protecting my privacy): Image
I'll try to reproduce and let you know. Thanks for the added info.
This bug still seems to be around and is reproducible with your test scene. Any updates on a fix?
@miketalbott this happens because of #56. For now, I'm just going to remove the pausing as I don't think it is important to pause Unity when the share sheet is opened.
Actually it seems that the pausing has already been removed:
It must be something else. I'll repro today.
Reproduced. Investigating now.
The crash happens because iOS invokes the completion handler twice, first when the user cancels (which gets sent to Unity), and again when the user closes the share sheet (which causes the crash):
yup. that would make sense because it only happens if you select an app to share with and then cancel.
I'm trying to get any app out today. would you have any ideas on a hot fix? should I try to modify the iOS code? (Unfortunately, I don't know ObjC).
Fixed in dab4ed60ddf883bf1fd111683bea7960e7bd039a.
@miketalbott I'm pushing all these changes to this PR: #93 . Android is WIP but iOS is all good, so you can deploy it on iOS.
Hello,
I found a bug in the sharing dialog on iOS System:
NatShare causes the application to freeze when discarding sharing, to reproduce:
`2020-04-20 18:03:28.081025+0300 app[447:40752] [LayoutConstraints] Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. ( "= 22 (active)>",
"<NSLayoutConstraint:0x282a1c410 V:|-(15)-[_UIActivityActionCellTitleLabel:0x129d26ce0] (active, names: '|':UIView:0x129d269b0 )>",
"<NSLayoutConstraint:0x282a1c460 V:[_UIActivityActionCellTitleLabel:0x129d26ce0]-(15)-| (active, names: '|':UIView:0x129d269b0 )>",
"<NSLayoutConstraint:0x282a28e60 'UIView-Encapsulated-Layout-Height' UIView:0x129d269b0.height == 51.5 (active)>"
)
Will attempt to recover by breaking constraint