dragermrb / capacitor-plugin-video-editor

Capacitor plugin to edit videos
12 stars 8 forks source link

Android Permission App Crash #3

Closed AdlerJS closed 1 year ago

AdlerJS commented 1 year ago

Hey @dragermrb. We are using this plugin to generate thumbnail previews for movie / video files saved on a user's phone. It's working perfectly on iOS but there seems to be an issue on Android around permissions.

The following is our code:

      const { value: devicePath } = await Preferences.get({
        key: storageKey,
      });

      if (devicePath) {
        const { uri } = await Filesystem.getUri({
          path: devicePath,
          directory: getDataDirectory(),
        });

        if (uri) {
          try {
            const { file } = await VideoEditor.thumbnail({
              path: normalizeVideoPath(uri),
              width: 600,
              height: 600,
              at: 0,
            });

            setFileThumbnail(Capacitor.convertFileSrc(file.path));
          } catch (error) {
            appInsights.trackException({
              exception: error,
              severityLevel: SeverityLevel.Error,
              properties: { name: 'thumbnail creation', fileId },
            });
          }
        }

And in out appInsights we are observing the following error after the Android app completely crashes.

Error: User denied access to storage
    at returnResult (http://localhost/:745:32)
    at win.androidBridge.onmessage (http://localhost/:720:21)

Potential Solution:

Additional Note: Adding <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/> to the AndroidManifest.xml seems to help resolve it

dragermrb commented 1 year ago

Hi @danbunkr

Can you attach logcat output?

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 1 year ago

This issue was closed because it has been inactive for 14 days since being marked as stale.