Automattic/stories-android

Images on the picker failing to load / freezing the app

Closed this issue · 2 comments

mzorz commented

I’m not sure what’s up with the top three thumbnails… the ones that are solid grey. It looks like it might be something that is failing to load?

I tried to use one of those when making a story to see what would happen and it ended up freezing the app.

Screenshot_20201021-094127

mzorz commented

Been able to reproduce when first installing the app and giving permissions, - it shows some greyed out items in the media picker. Then picking one of the greyed out thumbnails ended up crashing WPAndroid with this stacktrace:

    --------- beginning of crash
2020-10-28 10:40:28.682 6968-6968/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: org.wordpress.android, PID: 6968
    java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.view.View.getContext()' on a null object reference
        at org.wordpress.android.widgets.WPSnackbar.<init>(WPSnackbar.java:31)
        at org.wordpress.android.widgets.WPSnackbar.make(WPSnackbar.java:85)
        at org.wordpress.android.ui.stories.StoryComposerActivity$setupStoryEditorMediaObserver$2.onChanged(StoryComposerActivity.kt:321)
        at org.wordpress.android.ui.stories.StoryComposerActivity$setupStoryEditorMediaObserver$2.onChanged(StoryComposerActivity.kt:67)
        at androidx.lifecycle.LiveData.considerNotify(LiveData.java:131)
        at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:149)
        at androidx.lifecycle.LiveData.setValue(LiveData.java:307)
        at androidx.lifecycle.MutableLiveData.setValue(MutableLiveData.java:50)
        at org.wordpress.android.ui.stories.media.StoryEditorMedia$addNewMediaItemsToEditorAsync$1.invokeSuspend(StoryEditorMedia.kt:88)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

mzorz commented

Okay I was able to single out these greyed out files as being the ones that are captured and saved with the Stories library capture mode itself, after a re-install.

Steps to reproduce:

  1. install WPAndroid, log in, create a story by capturing a couple of pictures with stories capture mode
  2. save the story (publish)
  3. now go to media section and tap + to add
  4. observe the newly created slide can be seen there
  5. uninstall the app, and reinstall
  6. log in to WPAndroid
  7. go to media section and tap + to add
  8. observe you can only see the pictures captured with other apps, but the ones captured with the Stories library are greyed out.