vinzscam/react-native-file-viewer

Could not open apk file

Opened this issue · 1 comments

My code:

const apkPath = './src/app.apk';
      await FileViewer.open(apkPath, {
        showOpenWithDialog: true,
        showAppsSuggestions: true,
      });

result:

[Error: Failed to find configured root that contains /src/app.apk]

Only absolute paths are accepted. You've given a relative path. And apk support is imperfect. It won't do anything when opening apk. But if there are multiple package installers in your device, it'll ask to choose one, and then you can install the apk.