capacitor-community / file-opener

Capacitor File Opener. The plugin is able to open a file given the mimeType and the file uri. This plugin is similar to cordova-plugin-file-opener2 without installation support.
MIT License
67 stars 13 forks source link

New requirements for gradle 8 #37

Closed luca-peruzzo closed 1 year ago

luca-peruzzo commented 1 year ago

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @capacitor-community/file-opener@1.0.4 for the project I'm working on.

Please replace the package attribute in AndroidManifest.xml with the namespace attribute in build.gradle cause is required by gradle 8.

Here is the diff that solved my problem:

diff --git a/node_modules/@capacitor-community/file-opener/android/build.gradle b/node_modules/@capacitor-community/file-opener/android/build.gradle
index 3de9898..6b91629 100644
--- a/node_modules/@capacitor-community/file-opener/android/build.gradle
+++ b/node_modules/@capacitor-community/file-opener/android/build.gradle
@@ -18,6 +18,7 @@ buildscript {
 apply plugin: 'com.android.library'

 android {
+    namespace "com.ryltsov.alex.plugins.file.opener"
     compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 32
     defaultConfig {
         minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
diff --git a/node_modules/@capacitor-community/file-opener/android/src/main/AndroidManifest.xml b/node_modules/@capacitor-community/file-opener/android/src/main/AndroidManifest.xml
index a06bff2..3ff16af 100644
--- a/node_modules/@capacitor-community/file-opener/android/src/main/AndroidManifest.xml
+++ b/node_modules/@capacitor-community/file-opener/android/src/main/AndroidManifest.xml
@@ -1,5 +1,4 @@
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.ryltsov.alex.plugins.file.opener">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android">

     <application>
         <provider

This issue body was partially generated by patch-package.

ryaa commented 1 year ago

The required changes have been included into the new release 1.0.5 - see https://github.com/capacitor-community/file-opener/blob/chore/release-1.0.5/CHANGELOG.md