Ionic 4 fails to build for Android.
To Reproduce(If applicable)
I have had the following issues:
I tried to run the following command:
npm install cordova.plugin.zoom
npm install @ionic-native/zoom
ionic cap sync
and ionic install the apk on device but when I use a zoom function I have the following error: ‘plugin_not_installed’ Install the Zoom plugin: ‘ionic cordova plugin add cordova.plugin.zoom’
I run the command ‘ionic cordova plugin add cordova.plugin.zoom’ then I add last platform of android (8.1.0) with minSdkVersion=21 and targetSdkVersion=29 but i have the following error: ‘AAPT: error: attribute android:foregroundServiceType not found.’
Then I have tried the following solution:
After upgrading to v4.4.55968.0904 error: failed processing manifest
setting the build-extras.gradle file in 'plugins/cordova.plugin.zoom/src/android/biuld-extras.gradle but I have the following error: “A problem occurred evaluating script. Project with path ‘:commonlib’ could not be found in project ‘:app’.”
Then I’ve made the changes suggested here:
Integration with Ionic5 Capacitor and Vuejs
copying the file commonlib.aar and mobilerct.aar also in libs directory but the error has remained.
Finally, I added "include ‘:commonlib’ " on the top of build-extras.gradle, but I have this error "A problem occurred evaluating script.
Could not find method include() for arguments [:commonlib] on project ‘:app’ of type org.gradle.api.Project."
With each change I remove the android platform and add it again.
Where am I wrong? What can I do to fix the problem? The plugin is very complete and I need to use it.