Unable to build ionic app using the ibm-mfp-push cordova plugin on Android (conflict with google-analytics cordova plugin) - ionic-framework

I've been developing an Ionic app for several months, successfully using the ibm-mfp-push plugin for Push Notifications.
I would now need to use the cordova-plugin-google-analytics plugin.
I've added the plugin to my project and was able to make it work properly on iOS.
But when trying to build the project for android, I get the following error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzpz;
Seems like there is a conflict between ibm-mfp-push and cordova-google-analytics.
Could someone please provide some help?
Thanks

Right now adding this Google Analytics plugin for Cordova does result in a conflict with the ibm-mfp-push plugin -- I am able to recreate and confirm. I've let the service team know.
For the time being, I recommend using the native solution for Android.

Related

HMS Toolkit Build error - not finding dependency in repositories

I am trying to port an app for AppGallery. While trying to build over HMS it is giving me the following error:
* What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not find com.huawei.hms:ads-identifier:3.4.40.300.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/huawei/hms/ads-identifier/3.4.40.300/ads-identifier-3.4.40.300.pom
- https://jcenter.bintray.com/com/huawei/hms/ads-identifier/3.4.40.300/ads-identifier-3.4.40.300.pom
- https://maven.google.com/com/huawei/hms/ads-identifier/3.4.40.300/ads-identifier-3.4.40.300.pom
- https://developer.huawei.com/repo/com/huawei/hms/ads-identifier/3.4.40.300/ads-identifier-3.4.40.300.pom
Required by:
The repository is indeed in the gradle file. Any help will be appreciated
Strangely, it seems that the HMS converter, although the latest version is adding some old dependencies:
Could not find com.huawei.hms:hwid:5.3.0.301 & push kit when adding HMS alongside GMS using HMS Toolkit
after updating to a newer version the errors were resolved.

Could not find gradle flutter

I created a new flutter project by VS Code. but I don't know why I am got this error on run
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'android'.
Could not resolve all artifacts for configuration ':classpath'.
Could not find com.android.tools.build:gradle:3.6.2.
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.6.2/gradle-3.6.2.pom
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.6.2/gradle-3.6.2.jar
https://jcenter.bintray.com/com/android/tools/build/gradle/3.6.2/gradle-3.6.2.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.6.2/gradle-3.6.2.jar
https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/3.6.2/gradle-3.6.2.pom
https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/3.6.2/gradle-3.6.2.jar
https://maven.google.com/com/android/tools/build/gradle/3.6.2/gradle-3.6.2.pom
https://maven.google.com/com/android/tools/build/gradle/3.6.2/gradle-3.6.2.jar
I searched a lot for the gradle problem but I can't see any solution
I installed Android studio, Android SDK 29, Flutter SDK and VS code plugins
I think you need to open the android folder with AndroidStudio and let Gradle to download android dependencies.
solution:
if some countries have been banned maybe you need to use some VPN to download these dependencies. Hotspot shield is a good option cause it will change the IP address of your machine.

How to Create Custom SplashScreen on Ionic?

I want show custom splash screen with animation. I tried add LottieSplashScreen plugin but i can't do this.
Tried with this code
cordova plugin add cordova-plugin-lottie-splashscreen
But i facing
'sh' is not recognized as an internal or external command,
operable program or batch file.
Failed to install 'cordova-plugin-lottie-splashscreen': Error: Hook failed with error code ENOENT: C:\Users\bbara\Desktop\GuvercinSepetim\plugins\cordova-plugin-lottie-splashscreen\hooks\ios\update_pod_repo.sh
at C:\Users\bbara\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\hooks\HooksRunner.js:224:23
at _rejected (C:\Users\bbara\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:864:24)
at C:\Users\bbara\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:890:30
at Promise.when (C:\Users\bbara\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:1142:31)
at Promise.promise.promiseDispatch (C:\Users\bbara\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:808:41)
at C:\Users\bbara\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:624:44
at runSingle (C:\Users\bbara\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:137:13)
at flush (C:\Users\bbara\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:125:13)
at processTicksAndRejections (internal/process/next_tick.js:74:9)
Hook failed with error code ENOENT: C:\Users\bbara\Desktop\GuvercinSepetim\plugins\cordova-plugin-lottie-splashscreen\hooks\ios\update_pod_repo.sh
You are running a cordova node but not ionic cordova:
cordova plugin add cordova-plugin-lottie-splashscreen
According to ionic documentation:
npm install #ionic-native/lottie-splash-screen
ionic cordova plugin add cordova-plugin-lottie-splashscreen
And here is the referance:
https://ionicframework.com/docs/native/lottie-splash-screen
And here is the github reposatory of the plugin :
https://github.com/timbru31/cordova-plugin-lottie-splashscreen
Try looking into Capacitor instead of Cordova. You can still use all your Cordova libraries, but the Capacitor build is a bit cleaner. I followed this tutorial and found it very useful with good tools. It worked for me first time, which is never the case with some Ionic stuff!
https://enappd.com/blog/icon-splash-in-ionic-react-capacitor-apps/114/
The issue you are describing was fixed in the v0.8.1 release. It originated from preparing/building the iOS platform on a Windows machine - which won't work anyways. Because cordova-ios supports recent Pod installations out of the box, it's no longer required to sync the repo, i.e, the hook is obsolete. However, the lottie plugin won't fail anymore.
Side note: I'm the author of this plugin.

Cordova-camera plugin

When adding cordova camera plugin into my project then i am facing cordova build problem as follows:
Step 1: Adding ionic cordova camera plugins
Step 2: try to build the native app using ionic cordova build android --debug
then the following error is displaying
Task :app:transformClassesWithMultidexlistForDebug FAILED
D8: Program type already present: android.support.v4.app.ActionBarDrawerToggle$Delegate
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.
com.android.build.api.transform.TransformException: Error while generating the main dex list:
Error while merging dex archives:
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
Program type already present: android.support.v4.app.ActionBarDrawerToggle$Delegate
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd build android --debug exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
This problem may be from your AndroidManifest.xml. Open your AndroidManifest.xml file and find android.support.v4.app.ActionBarDrawerToggle, you will find two line for this. Comment one of them and keep only one android.support.v4.app.ActionBarDrawerToggle. Then try to run again.
This will may help you.
I change cordova-camera plugin version from 4.3.0 to 4.1.0 and now it works well this may be ionic v4 plugin issue
install the latest cordova platform[
]1

Flutter build error. Issue with flutter webview plugin

I have added the flutter webview plugin but its causing problems. Its giving some error when building the project. I tried to delete the cache and rebuild the project but it didn't work.
I just started learning flutter and can't find a solution to this problem.
Below is the error I am getting.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':flutter_webview_plugin:compileDebugJavaWithJavac'.
Unable to find source java class: 'C:\Users\personal\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\flutter_webview_plugin-0.0.9+1\android\src\main\java\com\flutter_webview_plugin\WebviewActivity.java' because it does not belong to any of the source dirs: '[C:\Users\personal\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\flutter_webview_plugin-0.1.5\android\src\main\java, C:\Users\personal\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\flutter_webview_plugin-0.1.5\android\src\debug\java, C:\Users\personal\Documents\AndroidStudioProjects\flutter_newz\build\flutter_webview_plugin\generated\source\r\debug, C:\Users\personal\Documents\AndroidStudioProjects\flutter_newz\build\flutter_webview_plugin\generated\source\buildConfig\debug, C:\Users\personal\Documents\AndroidStudioProjects\flutter_newz\build\flutter_webview_plugin\generated\source\aidl\debug, C:\Users\personal\Documents\AndroidStudioProjects\flutter_newz\build\flutter_webview_plugin\generated\source\rs\debug]'
BUILD FAILED in 54s
Finished with error: Gradle build failed: 1
I was using other plugins for firebase auth, firebase analytics, google sign in , webview, ect. Updating all the plugins to the latest version solved the problem.