Closed AdlerJS closed 2 years ago
I was able to solve it right after adding this issue but going to leave the solution below.
Step 1: Make sure to add the required dependencies. via NPM install
"cordova-plugin-androidx": "^3.0.0",
"cordova-plugin-androidx-adapter": "^1.1.3",
Step 2: If using capacitor since the Ionic Native package has not been updated you need to add the following to your android config.xml
<feature name="PreviewAnyFile">
<param name="android-package" value="com.mostafa.previewanyfile.PreviewAnyFile"/>
</feature>
Closing this issue has the solution above should solve it for most users. Hopefully once Ionic Native update gets released the Step 2 will not be required. Thanks for the plugin!
Appreciate your contribution
Regards,
Mostafa Mansour Software Engineer 00971 524988466
On 20 Sep 2021, at 8:09 PM, Dan Adler @.***> wrote:
I was able to solve it right after adding this issue but going to leave the solution below.
Step 1: Make sure to add the required dependencies. via NPM install
"cordova-plugin-androidx": "^3.0.0",
"cordova-plugin-androidx-adapter": "^1.1.3",
Step 2: If using capacitor since the Ionic Native package has not been updated you need to add the following to your android config.xml
<feature name="PreviewAnyFile">
<param name="android-package" value="com.mostafa.previewanyfile.PreviewAnyFile"/>
</feature>
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/mostafa-mansour1/previewAnyFile/issues/36#issuecomment-923068108, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABSFOB2ZB5BPQ5HYDGHWRBTUC5MBVANCNFSM5EMIMHAA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
When using on Capacitor 3 for Android I am getting the following error in the logcat console.
Line 34005 - Msg: ERROR Class not found
I am using React and Capacitor 3 to implement the plugin which is working as expected on IOS but throws the error above on Android. Below is the custom hook that wraps this plugin.
I have been unable to trace down where exactly the error is occurring or what is causing it. However I can confirm it happens on the
await window.PreviewAnyFile.previewPath(onSuccess, onError, result);
line