capacitor-community / contacts

Contacts Plugin for Capacitor
https://capacitor-community.github.io/contacts/
119 stars 52 forks source link

Add namespace in build.gradle to fix android compilation issue on Capacitor 5.x.x #106

Closed r2g closed 1 year ago

r2g commented 1 year ago

Hi! 👋

Firstly, thanks for your work on this project! 🙂

The aim of this PR is to patch @capacitor-community/contacts@4.0.3 for the project I'm working on by adding the namespace to the android build.gradle file for the plugin to be compiled for android using capacitor 5.x.x

Here is the diff that solved my problem:

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

 android {
+    namespace 'getcapacitor.community.contacts'
     compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 32
     defaultConfig {
         minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
tafelnl commented 1 year ago

There's already a release that targets Capacitor v5. See also https://github.com/capacitor-community/contacts/issues/104#issuecomment-1538483068

On a side note, if you ever want to open a PR, please do so using Pull Requests instead of using Issues.