UIActivityView + Video --> Couldn't send message

Hello all!

I’m working on Earthtunes, an app to listen to the Solid Earth. Ad: It is available in the App Store is you wanna take a look (I’ll be happy to hear from you!)

The point is that this app generates a video to send a sound (not only earthquake, but a cut of the sound of a seismometer) by text, whatsapp…

...and…

sometimes, it raises an error saying that it could not send the video. I could not find the reason of it. I’m posting here [1] a simplified project that shows this error and I would like to ask you if you know what it is going on there.

It seems related to the video, but I'm always using the same codec and sometimes works, sometimes does not.

Thanks a lot!!!

[1] https://github.com/heltena/ExportTunes

How are you sharing these videos? Are you using UIActivityViewController?

Are there any clues in Console? Perhaps a log line made by the extension to which you are trying to share the item?

Hello!

Yes, I'm using UIActivityViewController inside the ActivityView, which is a UIViewControllerRepresentable.

I did some tests and I realized that the video, for some reason I don't understand yet, is not correct to publish, not only in Whatsapp, but Twitter as well. Because I cannot publish the video using the Twitter website, I think the problem is not the sharing (UIActivityViewController), but the video itself.

The console:

Start the app, click "Generate and Share", and show the Share Sheet:

2021-08-12 15:35:33.728845-0500 TestingEarthtunesVideo[7630:3804560] [Warning] Warning once only: Detected a case where constraints ambiguously suggest a height of zero for a table view cell's content view. We're considering the collapse unintentional and using standard height instead. Cell: <SwiftUI.ListCoreCellHost: 0x15c80f000; baseClass = UITableViewCell; frame = (0 216.667; 343 44); clipsToBounds = YES; autoresize = W; layer = <CALayer: 0x281e8e5c0>>

TemperaryFolder: file:///private/var/mobile/Containers/Data/Application/C12414B3-3120-43B8-92E5-8533512219EC/tmp/C52ECFEA-A0F3-49AB-B00D-24D8DE4807E1

2021-08-12 15:35:37.234098-0500 TestingEarthtunesVideo[7630:3804790] AVDRegister - AppleAVD HEVC codec registered

2021-08-12 15:35:37.234374-0500 TestingEarthtunesVideo[7630:3804790] AVDRegister - AppleAVD H264 codec registered

2021-08-12 15:35:37.234516-0500 TestingEarthtunesVideo[7630:3804790] AVDRegister - AppleAVD Leghorn codec registered

2021-08-12 15:35:39.662574-0500 TestingEarthtunesVideo[7630:3804560] [User Defaults] Couldn't read values in CFPrefsPlistSource<0x2830dfa80> (Domain: com.apple.Sharing, User: kCFPreferencesCurrentUser, ByHost: No, Container: kCFPreferencesNoContainer, Contents Need Refresh: Yes): accessing preferences outside an application's container requires user-preference-read or file-read-data sandbox access

2021-08-12 15:35:39.663361-0500 TestingEarthtunesVideo[7630:3804560] [User Defaults] Couldn't read values in CFPrefsPlistSource<0x2830dfa80> (Domain: com.apple.Sharing, User: kCFPreferencesCurrentUser, ByHost: No, Container: kCFPreferencesNoContainer, Contents Need Refresh: Yes): accessing preferences outside an application's container requires user-preference-read or file-read-data sandbox access

2021-08-12 15:35:39.666559-0500 TestingEarthtunesVideo[7630:3804560] <CATransformLayer: 0x281e71f80> - changing property backgroundColor in transform-only layer, will have no effect

2021-08-12 15:35:39.790171-0500 TestingEarthtunesVideo[7630:3804560] [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. 

(

    "<NSLayoutConstraint:0x283d82da0 _UIActivityActionCellTitleLabel:0x15d0db510.height >= 22.6667   (active)>",

    "<NSLayoutConstraint:0x283d93cf0 V:|-(15)-[_UIActivityActionCellTitleLabel:0x15d0db510]   (active, names: '|':UIView:0x15d0dc110 )>",

    "<NSLayoutConstraint:0x283d93d40 V:[_UIActivityActionCellTitleLabel:0x15d0db510]-(15)-|   (active, names: '|':UIView:0x15d0dc110 )>",

    "<NSLayoutConstraint:0x283d65a90 'UIView-Encapsulated-Layout-Height' UIView:0x15d0dc110.height == 52   (active)>"

)



Will attempt to recover by breaking constraint 

<NSLayoutConstraint:0x283d82da0 _UIActivityActionCellTitleLabel:0x15d0db510.height >= 22.6667   (active)>



Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.

The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.

2021-08-12 15:35:39.790711-0500 TestingEarthtunesVideo[7630:3804560] [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. 

(

    "<NSLayoutConstraint:0x283d6de00 _UIActivityActionCellTitleLabel:0x15d0e5170.height >= 22.6667   (active)>",

    "<NSLayoutConstraint:0x283d6d950 V:|-(15)-[_UIActivityActionCellTitleLabel:0x15d0e5170]   (active, names: '|':UIView:0x15d0e5d70 )>",

    "<NSLayoutConstraint:0x283d6d9a0 V:[_UIActivityActionCellTitleLabel:0x15d0e5170]-(15)-|   (active, names: '|':UIView:0x15d0e5d70 )>",

    "<NSLayoutConstraint:0x283d65e00 'UIView-Encapsulated-Layout-Height' UIView:0x15d0e5d70.height == 52   (active)>"

)



Will attempt to recover by breaking constraint 

<NSLayoutConstraint:0x283d6de00 _UIActivityActionCellTitleLabel:0x15d0e5170.height >= 22.6667   (active)>



Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.

The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.

2021-08-12 15:36:08.766396-0500 TestingEarthtunesVideo[7630:3805356] [WindowServer] display_timer_callback: unexpected state (now:8beca030708 < expected:8beca09199d)

At this point, when I'm selecting Whatsapp and the group, and click the send button, the error is presented, but nothing appears in the console.

To show the process of the video creation, I did a new repo with the code I'm using to generate the video and a little explanation in the README.md (copy & paste):

This is a repo to explain the error when uploading a video to social networks (twitter and whatsapp).

Try to upload this video to your twitter account:

<< check the repo, I cannot post videos here >>

Error in Twitter:

Error in Whatsapp:

If I'm running in the terminal:

$ ffmpeg -i Media/earthtunes.mp4 Media/earthtunes-ffmpeg.mp4

It is possible to post the new video on Twitter... (probably it will work on Whatsapp as well)

I appreciate your feedback!!!

https://github.com/heltena/TestingEarthtunesVideo

Thanks!!!!!

UIActivityView + Video --&gt; Couldn't send message
 
 
Q