Automattic / stories-android

Loop concept app - WP Stories library
GNU General Public License v2.0
17 stars 6 forks source link

Unable to upload story post with a video on some Android 13 and 14 devices #743

Open zwarm opened 7 months ago

zwarm commented 7 months ago

Multiple issues when trying to create a story post with video using Android 13 or Android 14

Tested on: Android 13, Samsung S20, Jetpack App 23.7.1

Steps to recreate on Android 13 using Jetpack 23.7.1

  1. Install the latest Jetpack version on a device running Android 13.

  2. Log in and navigate to "My Site."

  3. Tap the FAB and select "Story Post."

  4. Follow prompts on the initial pages.

  5. Select "Allow" when prompted, "Jetpack needs permission to access your photos and videos."

  6. Select "Allow" when the pop-up shows, "Allow Jetpack to access photos and videos on this device."

  7. On the "Choose Media" view, tap the images icon in the bottom tab bar.

  8. Tap "Choose video from this device."

  9. Select a video and "Add" it.

  10. On the image optimization pop-up, tap "Leave Off." Issue: The story post closes, and you are navigated back to the "My Site" view with the "Set reminders" bottom sheet shown.

  11. Retry by tapping the FAB and select "Story Post."

  12. On the "Choose Media" view, tap the images icon in the bottom tab bar.

  13. Tap "Choose video from this device."

  14. Select a video and "Add" it (Note: The Image optimization pop-up will not be shown again).

  15. The video should load, and the story preview is shown.

  16. Publish your story by tapping the "->" in the upper right-hand corner.

  17. Give your story a title and tap "Publish Now."

  18. You will be navigated back to the "My Site" view, where a snackbar will be shown alerting you there was an error uploading your video with an action to "manage" it.

Manage It Flow:

  1. Tap the "Manage" action on the snackbar (be fast, it doesn't stay on screen long). Issue: Note there are multiple error message pop-ups "Unable to save 1 slide" and "An error occurred while playing your video."
  2. Retry the action. Issue: The retry will fail. The only way out is to discard the story.

Do Not Manage It Flow:

  1. Do not tap on the "Manage" action in the snackbar.
  2. Navigate to "Posts > Drafts."
  3. Find the story you just created, right-click on the context menu, and tap "Publish." Issue: The story will be published, but it will not include the video. If you tap "edit" the post context menu instead of "publish," the post draft will not contain the video.

Tested on Android 14, Android Pixel 5 - See video Video: https://github.com/Automattic/stories-android/assets/506707/8dc790ce-b389-47e0-8c7f-9f31281ac3a0

zwarm commented 7 months ago

Additional Log Info

at android.os.Parcel.createExceptionOrNull(Parcel.java:3057)
at android.os.Parcel.createException(Parcel.java:3041)
at android.os.Parcel.readException(Parcel.java:3024)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:190)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142)
at android.content.ContentProviderProxy.query(ContentProviderNative.java:495)
at android.content.ContentResolver.query(ContentResolver.java:1229)
at android.content.ContentResolver.query(ContentResolver.java:1161)
at android.content.ContentResolver.query(ContentResolver.java:1117)
at org.wordpress.android.util.MediaUtils.getDataColumn(MediaUtils.java:530)
at org.wordpress.android.util.MediaUtils.getPath(MediaUtils.java:430)
at org.wordpress.android.util.MediaUtils.getRealPathFromURI(MediaUtils.java:401)
at org.wordpress.android.util.MediaUtilsWrapper.getRealPathFromURI(MediaUtilsWrapper.kt:23)
at org.wordpress.android.ui.posts.editor.media.OptimizeMediaUseCase.optimizeMedia(OptimizeMediaUseCase.kt:46)
at org.wordpress.android.ui.posts.editor.media.OptimizeMediaUseCase.access$optimizeMedia(OptimizeMediaUseCase.kt:20)
at org.wordpress.android.ui.posts.editor.media.OptimizeMediaUseCase$optimizeMediaIfSupportedAsync$2$1$1.invokeSuspend(OptimizeMediaUseCase.kt:34)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Failed to get type for: content://media/picker/0/com.android.providers.media.photopicker/media/1000000893 (Calling uid ( 11346 does not have permission to access picker uri: content://media/picker/0/com.android.providers.media.photopicker/media/1000000893)
Error reading _data column for URI: content://media/picker/0/com.android.providers.media.photopicker/media/1000000893
                                                                       java.lang.SecurityException: Calling uid ( 11346 ) does not have permission to access picker uri: content://media/picker/0/com.android.providers.media.photopicker/media/1000000893
at android.os.Parcel.createExceptionOrNull(Parcel.java:3057)
at android.os.Parcel.createException(Parcel.java:3041)
at android.os.Parcel.readException(Parcel.java:3024)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:190)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142)
at android.content.ContentProviderProxy.query(ContentProviderNative.java:495)
at android.content.ContentResolver.query(ContentResolver.java:1229)
at android.content.ContentResolver.query(ContentResolver.java:1161)
at android.content.ContentResolver.query(ContentResolver.java:1117)
at org.wordpress.android.util.MediaUtils.getDataColumn(MediaUtils.java:530)
at org.wordpress.android.util.MediaUtils.getPath(MediaUtils.java:430)
at org.wordpress.android.util.MediaUtils.getRealPathFromURI(MediaUtils.java:401)
at org.wordpress.android.util.MediaUtilsWrapper.getRealPathFromURI(MediaUtilsWrapper.kt:23)
at org.wordpress.android.ui.posts.editor.media.OptimizeMediaUseCase.optimizeMedia(OptimizeMediaUseCase.kt:46)
at org.wordpress.android.ui.posts.editor.media.OptimizeMediaUseCase.access$optimizeMedia(OptimizeMediaUseCase.kt:20)
at org.wordpress.android.ui.posts.editor.media.OptimizeMediaUseCase$optimizeMediaIfSupportedAsync$2$1$1.invokeSuspend(OptimizeMediaUseCase.kt:34)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)