Problem with plugin cordova-sqlite-storage - android

I have a problem with a project of cordova (Ionic), the app compile sucefully. But when I add cordova-sqlite-storage plugin.
cordova plugin add cordova-sqlite-storage --save
the compile break.
└────╼ ionic cordova build android
> ionic-app-scripts build --target cordova --platform android
> cordova build android
9.0.0
cordova-android-support-gradle-release: Android platform: V7+
cordova-android-support-gradle-release: Wrote custom version '27.+' to /home/dylan-roman/Documentos/projects/adnmovil/platforms/android/app/build.gradle
cordova-android-support-gradle-release: Wrote custom version '27.+' to /home/dylan-roman/Documentos/projects/adnmovil/platforms/android/cordova-android-support-gradle-release/movil-cordova-android-support-gradle-release.gradle
cordova-android-support-gradle-release: Android platform: V7+
cordova-android-support-gradle-release: Wrote custom version '27.+' to /home/dylan-roman/Documentos/projects/adnmovil/platforms/android/app/build.gradle
cordova-android-support-gradle-release: Wrote custom version '27.+' to /home/dylan-roman/Documentos/projects/adnmovil/platforms/android/cordova-android-support-gradle-release/movil-cordova-android-support-gradle-release.gradle
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=/home/dylan-roman/Android/Sdk (recommended setting)
ANDROID_HOME=/home/dylan-roman/Android/Sdk (DEPRECATED)
Using Android SDK: /home/dylan-roman/Android/Sdk
Subproject Path: CordovaLib
Subproject Path: app
> Configure project :app
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed in version 5.0 of the Android Gradle plugin.
For more information, see http://d.android.com/r/tools/update-dependency-configurations.html.
+-----------------------------------------------------------------
| cordova-android-support-gradle-release: 27.+
+-----------------------------------------------------------------
> Task :app:stripDebugDebugSymbols FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:stripDebugDebugSymbols'.
> No version of NDK matched the requested version 21.0.6113669. Versions available locally: 22.0.6917172
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 2s
40 actionable tasks: 11 executed, 29 up-to-date
Command failed with exit code 1: /home/dylan-roman/Documentos/projects/adnmovil/platforms/android/gradlew cdvBuildDebug -b /home/dylan-roman/Documentos/projects/adnmovil/platforms/android/build.gradle
[ERROR] An error occurred while running subprocess cordova.
cordova build android exited with exit code 1.
Re-running this command with the --verbose flag may provide more information
If I remove the plugin compile sucefully
I allready try remove the plataform and then add android and cordova prepare
Please help me

I had some simliar problems with cordova on Mac OS while compiling for ios. I switched to cordova-plugin-sqlite-2 and it fixed the problem for me. You dont need to made any code changes, just install this plugin instead of the other sql plugin.

Related

React Native run - Android producing strange error

I'd like to ask about the following error. So I've been developing a small BLE app a year ago and successfully managed to implement it. I did not push it to the Google Play store but instead installed it somehow on the Android via usb.
However, now I need to get it back up and running but am facing a plethora of errors.
PS C:\Users\stefanec\Desktop\SOC\i_garden\i_garden\iGard> npx react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1302 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Installing the app...
> Configure project :app
Installing unimodules:
unimodules-core#5.0.0 from C:\Users\stefanec\Desktop\SOC\i_garden\i_garden\iGard\node_modules\#unimodules\core
unimodules-react-native-adapter#5.0.0 from C:\Users\stefanec\Desktop\SOC\i_garden\i_garden\iGard\node_modules\#unimodules\react-native-adapter
expo-app-loader-provider#8.0.0 from C:\Users\stefanec\Desktop\SOC\i_garden\i_garden\iGard\node_modules\expo-app-loader-provider
expo-constants#8.0.0 from C:\Users\stefanec\Desktop\SOC\i_garden\i_garden\iGard\node_modules\expo-constants
expo-error-recovery#1.0.0 from C:\Users\stefanec\Desktop\SOC\i_garden\i_garden\iGard\node_modules\expo-error-recovery
expo-file-system#8.0.0 from C:\Users\stefanec\Desktop\SOC\i_garden\i_garden\iGard\node_modules\expo-file-system
expo-font#8.0.0 from C:\Users\stefanec\Desktop\SOC\i_garden\i_garden\iGard\node_modules\expo-font
expo-keep-awake#8.0.0 from C:\Users\stefanec\Desktop\SOC\i_garden\i_garden\iGard\node_modules\expo-keep-awake
expo-linear-gradient#8.0.0 from C:\Users\stefanec\Desktop\SOC\i_garden\i_garden\iGard\node_modules\expo-linear-gradient
expo-location#8.0.0 from C:\Users\stefanec\Desktop\SOC\i_garden\i_garden\iGard\node_modules\expo-location
expo-permissions#8.0.0 from C:\Users\stefanec\Desktop\SOC\i_garden\i_garden\iGard\node_modules\expo-permissions
expo-sqlite#8.0.0 from C:\Users\stefanec\Desktop\SOC\i_garden\i_garden\iGard\node_modules\expo-sqlite
expo-web-browser#8.0.0 from C:\Users\stefanec\Desktop\SOC\i_garden\i_garden\iGard\node_modules\expo-web-browser
unimodules-barcode-scanner-interface#5.0.0 from C:\Users\stefanec\Desktop\SOC\i_garden\i_garden\iGard\node_modules\unimodules-barcode-scanner-interface
unimodules-camera-interface#5.0.0 from C:\Users\stefanec\Desktop\SOC\i_garden\i_garden\iGard\node_modules\unimodules-camera-interface
unimodules-constants-interface#5.0.0 from C:\Users\stefanec\Desktop\SOC\i_garden\i_garden\iGard\node_modules\unimodules-constants-interface
unimodules-face-detector-interface#5.0.0 from C:\Users\stefanec\Desktop\SOC\i_garden\i_garden\iGard\node_modules\unimodules-face-detector-interface
unimodules-file-system-interface#5.0.0 from C:\Users\stefanec\Desktop\SOC\i_garden\i_garden\iGard\node_modules\unimodules-file-system-interface
unimodules-font-interface#5.0.0 from C:\Users\stefanec\Desktop\SOC\i_garden\i_garden\iGard\node_modules\unimodules-font-interface
unimodules-image-loader-interface#5.0.0 from C:\Users\stefanec\Desktop\SOC\i_garden\i_garden\iGard\node_modules\unimodules-image-loader-interface
unimodules-permissions-interface#5.0.0 from C:\Users\stefanec\Desktop\SOC\i_garden\i_garden\iGard\node_modules\unimodules-permissions-interface
unimodules-sensors-interface#5.0.0 from C:\Users\stefanec\Desktop\SOC\i_garden\i_garden\iGard\node_modules\unimodules-sensors-interface
unimodules-task-manager-interface#5.0.0 from C:\Users\stefanec\Desktop\SOC\i_garden\i_garden\iGard\node_modules\unimodules-task-manager-interface
The Kotlin Gradle plugin was loaded multiple times in different subprojects, which is not supported and may break the build.
This might happen in subprojects that apply the Kotlin plugins with the Gradle 'plugins { ... }' DSL if they specify explicit versions, even if the versions are equal.
Please add the Kotlin plugin to the common parent project or the root project, then remove the versions in the subprojects.
If the parent project does not need the plugin, add 'apply false' to the plugin line.
See: https://docs.gradle.org/current/userguide/plugins.html#sec:subprojects_plugins_dsl
The Kotlin plugin was loaded in the following projects: ':expo-error-recovery', ':expo-permissions'
> Task :#react-native-community_async-storage:compileDebugJavaWithJavac FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.10.2/userguide/command_line_interface.html#sec:command_line_warnings
10 actionable tasks: 1 executed, 9 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':#react-native-community_async-storage:compileDebugJavaWithJavac'.
> Could not find tools.jar. Please check that C:\Program Files (x86)\Java\jre1.8.0_251 contains a valid JDK installation.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 31s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
PS C:\Users\stefanec\Desktop\SOC\i_garden\i_garden\iGard>
Looks like you don't have JDK installed.
Use the command below to install it with brew if you're on a Mac or follow the docs to how to install on your specific machine
brew install --cask adoptopenjdk/openjdk/adoptopenjdk8
Follow this guide to install on windows
See docs https://reactnative.dev/docs/_getting-started-macos-android#installing-dependencies

Ionic Cordova run failure for "ionic cordova run android"

I have an Ionic Cordova app that I have not touched in a few months. I wanted to make a small tweak to the app today and release it but when I did, I started having a dependency issue.
When I try to run 'ionic cordova run android' the build fails. Even without making any changes to the app (revert all changes and try to build what worked for the last APK) it still is failing. I have tried uninstalling the cordova intercom plugin and that changed nothing. I have also tried updating all of my npm packages and that did not help either.
This is the error log I get:
cordova run android
Android Studio project detected
cordova-android-firebase-gradle-release: Android platform: cordova-android#7
cordova-android-firebase-gradle-release: No custom version found in config.xml - using plugin default
cordova-android-play-services-gradle-release: Android platform: cordova-android#7
cordova-android-play-services-gradle-release: No custom version found in config.xml - using plugin default
cordova-android-support-gradle-release: Android platform: cordova-android#7
cordova-android-support-gradle-release: No custom version found in config.xml - using plugin default
Preparing Firebase on Android
ANDROID_HOME=C:\Users\Boogaloo\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_171
studio
Subproject Path: CordovaLib
Subproject Path: app
publishNonDefault is deprecated and has no effect anymore. All variants are now published.
cordova-android-firebase-gradle-release: 15.0.0
cordova-android-play-services-gradle-release: 15.0.0
cordova-android-support-gradle-release: 27.+
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_8vin5yy2zwz3fxyzepqpp0rqu.run(C:\Users\Boogaloo\WebstormProjects\IONIC\projects\myapp\platforms\android\app\build.gradle:151)
FAILURE: Build failed with an exception.
Where:
Script 'C:\Users\Boogaloo\WebstormProjects\IONIC\projects\myapp\platforms\android\cordova-plugin-intercom\savings-build-extras-intercom.gradle' line: 71
What went wrong:
A problem occurred configuring project ':app'.
Could not resolve all dependencies for configuration ':app:compile'.
Could not find com.google.android.gms:strict-version-matcher-plugin:15.0.0.
Searched in the following locations:
file:/C:/Users/Boogaloo/AppData/Local/Android/Sdk/extras/m2repository/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.pom
file:/C:/Users/Boogaloo/AppData/Local/Android/Sdk/extras/m2repository/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.jar
file:/C:/Users/Boogaloo/AppData/Local/Android/Sdk/extras/google/m2repository/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.pom
file:/C:/Users/Boogaloo/AppData/Local/Android/Sdk/extras/google/m2repository/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.jar
file:/C:/Users/Boogaloo/AppData/Local/Android/Sdk/extras/android/m2repository/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.pom
file:/C:/Users/Boogaloo/AppData/Local/Android/Sdk/extras/android/m2repository/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.jar
https://jcenter.bintray.com/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.pom
https://jcenter.bintray.com/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.jar
https://maven.google.com/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.pom
https://maven.google.com/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.jar
https://repo1.maven.org/maven2/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.pom
https://repo1.maven.org/maven2/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.jar
https://dl.google.com/dl/android/maven2/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.pom
https://dl.google.com/dl/android/maven2/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.jar
Required by:
project :app > com.google.gms:google-services:4.2.0
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Get more help at https://help.gradle.org
BUILD FAILED in 3s
(node:3432) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
Where:
Script 'C:\Users\Boogaloo\WebstormProjects\IONIC\projects\myapp\platforms\android\cordova-plugin-intercom\savings-build-extras-intercom.gradle' line: 71
What went wrong:
A problem occurred configuring project ':app'.
Could not resolve all dependencies for configuration ':app:compile'.
Could not find com.google.android.gms:strict-version-matcher-plugin:15.0.0.
Searched in the following locations:
file:/C:/Users/Boogaloo/AppData/Local/Android/Sdk/extras/m2repository/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.pom
file:/C:/Users/Boogaloo/AppData/Local/Android/Sdk/extras/m2repository/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.jar
file:/C:/Users/Boogaloo/AppData/Local/Android/Sdk/extras/google/m2repository/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.pom
file:/C:/Users/Boogaloo/AppData/Local/Android/Sdk/extras/google/m2repository/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.jar
file:/C:/Users/Boogaloo/AppData/Local/Android/Sdk/extras/android/m2repository/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.pom
file:/C:/Users/Boogaloo/AppData/Local/Android/Sdk/extras/android/m2repository/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.jar
https://jcenter.bintray.com/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.pom
https://jcenter.bintray.com/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.jar
https://maven.google.com/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.pom
https://maven.google.com/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.jar
https://repo1.maven.org/maven2/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.pom
https://repo1.maven.org/maven2/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.jar
https://dl.google.com/dl/android/maven2/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.pom
https://dl.google.com/dl/android/maven2/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.jar
Required by:
project :app > com.google.gms:google-services:4.2.0
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Get more help at https://help.gradle.org
BUILD FAILED in 3s
at ChildProcess.whenDone (C:\Users\Boogaloo\WebstormProjects\IONIC\projects\myapp\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
(node:3432) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:3432) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Update
I tried updating the cordova android platform to 7.1.0 but it hasn't helped.
I can't seem to delete the cordova firebase plugin using the command
ionic cordova plugin remove cordova-plugin-firebase
Do you use cordova-plugin-firebase?
If so,
run ionic cordova plugin remove cordova-plugin-firebase and try building again.
If it works, ionic cordova plugin add cordova-plugin-firebase#2.0.5

error when building cordova android due to plugin conflict

I am getting an error when building my cordova app that is linked to a plugin conflict. Namely the phonegap-plugin-push 2.2.3. When I remove the plugin everything compiles. Can you please help me to understand what I do wrong ?
compiler error (cordova build android)
Android Studio project detected
cordova-android-support-gradle-release ANDROID_SUPPORT_VERSION: 27.0.0
cordova-android-support-gradle-release : WROTE /Users/xxx/Desktop/VMSharedFolder/Projects/yyy/platforms/android/build.gradle > 27.0.0
ANDROID_HOME=/Users/xxx/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home
studio
BUILD SUCCESSFUL in 0s
1 actionable task: 1 executed
Subproject Path: CordovaLib
Subproject Path: app
publishNonDefault is deprecated and has no effect anymore. All variants are now published.
+-----------------------------------------------------------------
| cordova-android-support-gradle-release: 26.+
+-----------------------------------------------------------------
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_mghwmjggk8ms0ekw8jwhtovo.run(/Users/xxx/Desktop/VMSharedFolder/Projects/yyy/platforms/android/app/build.gradle:149)
FAILURE: Build failed with an exception.
* Where:
Script '/Users/xxx/Desktop/VMSharedFolder/Projects/yyy/platforms/android/cordova-support-google-services/almasport-build.gradle' line: 16
* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [class 'com.google.gms.googleservices.GoogleServicesPlugin']
> For input string: "11+"
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
/Users/xxx/Desktop/VMSharedFolder/Projects/yyy/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* Where:
Script '/Users/xxx/Desktop/VMSharedFolder/Projects/yyy/platforms/android/cordova-support-google-services/almasport-build.gradle' line: 16
* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [class 'com.google.gms.googleservices.GoogleServicesPlugin']
> For input string: "11+"
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
project.proterties
target=android-27
android.library.reference.1=CordovaLib
android.library.reference.2=app
cordova.gradle.include.1=cordova-android-support-gradle-release/almasport-cordova-android-support-gradle-release.gradle
cordova.system.library.1=com.android.support:support-v4:24.1.1+
cordova.gradle.include.2=cordova-plugin-code-push/almasport-build-extras.gradle
cordova.gradle.include.3=cordova-plugin-mauron85-background-geolocation/almasport-logtofile.gradle
cordova.system.library.2=com.google.android.gms:play-services-location:11+
cordova.system.library.3=com.android.support:support-v4:23+
cordova.gradle.include.4=cordova-support-google-services/almasport-build.gradle
cordova.gradle.include.5=phonegap-plugin-barcodescanner/almasport-barcodescanner.gradle
cordova.system.library.4=com.android.support:support-v4:27.+
cordova.gradle.include.6=phonegap-plugin-multidex/almasport-multidex.gradle
cordova.system.library.5=com.android.support:support-v13:27.+
cordova.system.library.6=me.leolin:ShortcutBadger:1.1.17#aar
cordova.system.library.7=com.google.firebase:firebase-messaging:11.6.2
Cordova plugin list
code-push 2.0.6 "CodePushAcquisition"
com.telerik.cordovaPlatformSpecificFiles 0.1.0 "Cordova Platform Specific Files"
cordova-android-support-gradle-release 1.2.0 "cordova-android-support-gradle-release"
cordova-plugin-camera 2.3.1 "Camera"
cordova-plugin-code-push 1.11.12 "CodePush"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-device-motion 1.2.3 "Device Motion"
cordova-plugin-device-orientation 1.0.5 "Device Orientation"
cordova-plugin-dialogs 1.3.1 "Notification"
cordova-plugin-file 4.3.1 "File"
cordova-plugin-file-transfer 1.6.1 "File Transfer"
cordova-plugin-geolocation 2.4.1 "Geolocation"
cordova-plugin-globalization 1.0.5 "Globalization"
cordova-plugin-insomnia 4.3.0 "Insomnia (prevent screen sleep)"
cordova-plugin-ionic-keyboard 2.1.2 "cordova-plugin-ionic-keyboard"
cordova-plugin-mauron85-background-geolocation 2.3.6 "CDVBackgroundGeolocation"
cordova-plugin-media 2.4.1 "Media"
cordova-plugin-media-capture 1.4.1 "Capture"
cordova-plugin-network-information 1.3.1 "Network Information"
cordova-plugin-splashscreen 4.0.1 "Splashscreen"
cordova-plugin-statusbar 2.2.2-dev "StatusBar"
cordova-plugin-vibration 2.1.3 "Vibration"
cordova-plugin-whitelist 1.3.1 "Whitelist"
cordova-plugin-x-toast 2.6.0 "Toast"
cordova-plugin-zip 3.1.0 "cordova-plugin-zip"
cordova-support-google-services 1.1.0 "cordova-support-google-services"
phonegap-plugin-barcodescanner 8.0.0 "BarcodeScanner"
phonegap-plugin-multidex 1.0.0 "Multidex"
phonegap-plugin-push 2.2.3 "PushPlugin"
cordova version 8.1.2
I guess this is an issue:
cordova.system.library.3=com.android.support:support-v4:23+
com.android.support:support-v4:27.+
com.android.support:support-v13:27.+
but i think it will be handled by the cordova-android-support-gradle-release 1.2.0 plugin.
So probably that the issue is linked to this:
com.google.android.gms:play-services-location:11+
com.google.firebase:firebase-messaging:11.6.2
if I change
com.google.android.gms:play-services-location:11+
with
com.google.android.gms:play-services-location:11.6.2, the error goes away. Now I don't want to do this everytime I create my platform, is there a way to explain what is happening and a better way to fix it ?
Thanks a log guys
This is a known phonegap issue. See More than one library with package name 'com.google.android.gms'

Error in Building PhoneGap App

I am getting an error in building a PhoneGap app. I am customizing this moodle app and rebuilding this app. I am getting the error below. I am following this post for customization.
Build Date: 2018-06-11 15:45:50 +0000
--------------------------------------------------------------------------------
PLUGIN OUTPUT
--------------------------------------------------------------------------------
Fetching plugin "cordova-plugin-file#4.3.3" via npm
Installing "cordova-plugin-file" at "4.3.3" for android
Fetching plugin "cordova-plugin-compat#^1.0.0" via npm
Installing "cordova-plugin-compat" at "1.2.0" for android
The Android Persistent storage location now defaults to "Internal". Please check this plugin's README to see if your application needs any changes in its config.xml.
If this is a new application no changes are required.
If this is an update to an existing application that did not specify an "AndroidPersistentFileLocation" you may need to add:
"<preference name="AndroidPersistentFileLocation" value="Compatibility" />"
to config.xml in order for the application to find previously stored files.
Fetching plugin "cordova-plugin-file-transfer#1.6.3" via npm
Installing "cordova-plugin-file-transfer" at "1.6.3" for android
Plugin dependency "cordova-plugin-file#4.3.3" already fetched, using that version.
Dependent plugin "cordova-plugin-file" already installed on android.
Fetching plugin "cordova-plugin-console#~1.0.0" via npm
Installing "cordova-plugin-console" at "1.0.7" for android
Fetching plugin "cordova-plugin-camera#2.4.1" via npm
Installing "cordova-plugin-camera" at "2.4.1" for android
Plugin dependency "cordova-plugin-compat#1.2.0" already fetched, using that version.
Dependent plugin "cordova-plugin-compat" already installed on android.
Subproject Path: CordovaLib
Fetching plugin "cordova-plugin-media-capture#1.4.3" via npm
Installing "cordova-plugin-media-capture" at "1.4.3" for android
Plugin dependency "cordova-plugin-file#4.3.3" already fetched, using that version.
Dependent plugin "cordova-plugin-file" already installed on android.
Plugin dependency "cordova-plugin-compat#1.2.0" already fetched, using that version.
Dependent plugin "cordova-plugin-compat" already installed on android.
Fetching plugin "cordova-plugin-device#1.1.6" via npm
Installing "cordova-plugin-device" at "1.1.6" for android
Fetching plugin "cordova-plugin-globalization#1.0.7" via npm
Installing "cordova-plugin-globalization" at "1.0.7" for android
Fetching plugin "cordova-plugin-inappbrowser#1.7.1" via npm
Installing "cordova-plugin-inappbrowser" at "1.7.1" for android
Fetching plugin "cordova-plugin-network-information#1.3.3" via npm
Installing "cordova-plugin-network-information" at "1.3.3" for android
Fetching plugin "cordova-plugin-statusbar#2.2.3" via npm
Installing "cordova-plugin-statusbar" at "2.2.3" for android
Fetching plugin "cordova-plugin-whitelist#1.3.2" via npm
Installing "cordova-plugin-whitelist" at "1.3.2" for android
This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
Fetching plugin "cordova-plugin-splashscreen#4.0.3" via npm
Installing "cordova-plugin-splashscreen" at "4.0.3" for android
Fetching plugin "cordova-universal-clipboard#0.1.0" via npm
Installing "cordova-universal-clipboard" at "0.1.0" for android
Fetching plugin "nl.kingsquare.cordova.background-audio#1.0.1" via npm
Installing "nl.kingsquare.cordova.background-audio" at "1.0.1" for android
Fetching plugin "phonegap-plugin-push#1.9.2" via npm
Installing "phonegap-plugin-push" at "1.9.2" for android
Subproject Path: CordovaLib
Fetching plugin "cordova-plugin-customurlscheme#4.3.0" via npm
Installing "cordova-plugin-customurlscheme" at "4.3.0" for android
Fetching plugin "ionic-plugin-keyboard#2.2.1" via npm
Installing "ionic-plugin-keyboard" at "2.2.1" for android
Fetching plugin "cordova-plugin-zip#3.1.0" via npm
Installing "cordova-plugin-zip" at "3.1.0" for android
Plugin dependency "cordova-plugin-file#4.3.3" already fetched, using that version.
Dependent plugin "cordova-plugin-file" already installed on android.
Fetching plugin "cordova-plugin-local-notifications-mm" via npm
Installing "cordova-plugin-local-notifications-mm" at "1.0.10" for android
Plugin dependency "cordova-plugin-device#1.1.6" already fetched, using that version.
Dependent plugin "cordova-plugin-device" already installed on android.
Fetching plugin "cordova-plugin-app-event" via npm
Installing "cordova-plugin-app-event" at "1.2.1" for android
Subproject Path: CordovaLib
Your support is needed. If you use the local-notification plugin please support us in order to ensure further development.
https://github.com/katzer/cordova-plugin-local-notifications#supporting
Thank you!
Fetching plugin "https://github.com/Tunts/WebIntent.git" via git clone
Using shallow clone
Repository "https://github.com/Tunts/WebIntent.git" checked out to git ref "master" at "15fcb4e".
Installing "net.tunts.webintent" at "0.2.1" for android
Fetching plugin "https://github.com/ti8m/DocumentHandler.git" via git clone
Using shallow clone
Repository "https://github.com/ti8m/DocumentHandler.git" checked out to git ref "master" at "f501154".
Installing "ch.ti8m.documenthandler" at "0.2.2" for android
--------------------------------------------------------------------------------
PROJECT PROPERTIES
--------------------------------------------------------------------------------
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-25
android.library.reference.1=CordovaLib
cordova.system.library.1=com.android.support:support-v4:24.1.1+
cordova.gradle.include.1=phonegap-plugin-push/moodle-push.gradle
cordova.system.library.2=com.android.support:support-v13:23+
cordova.system.library.3=com.google.android.gms:play-services-gcm:9.8+
cordova.system.library.4=me.leolin:ShortcutBadger:1.1.11#aar
cordova.system.library.5=com.android.support:support-v4:27.1.0
--------------------------------------------------------------------------------
COMPILE OUTPUT
--------------------------------------------------------------------------------
Subproject Path: CordovaLib
Running command: /project/gradlew cdvBuildDebug -b /project/build.gradle -Dorg.gradle.daemon=true -Dorg.gradle.jvmargs=-Xmx2048m -Pandroid.useDeprecatedNdk=true
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_4vswg8l01ivt4x0mvr9cvmwol.run(/project/build.gradle:138)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
The ProjectDependency.getProjectConfiguration() method has been deprecated and is scheduled to be removed in Gradle 4.0.
ModuleDependency.getConfiguration() has been deprecated and is scheduled to be removed in Gradle 4.0. Use ModuleDependency.getTargetConfiguration() instead.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'project'.
> Could not resolve all dependencies for configuration ':_debugApkCopy'.
> Could not find com.android.support:support-v4:27.1.0.
Required by:
project :
> Could not find com.android.support:support-v4:27.1.0.
Required by:
project :
> Could not find com.android.support:support-v4:27.1.0.
Required by:
project : > com.android.support:support-v13:23.4.0
> Could not find com.android.support:support-v4:27.1.0.
Required by:
project : > com.google.android.gms:play-services-gcm:9.8.0 > com.google.android.gms:play-services-basement:9.8.0
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1.363 secs
Command finished with error code 1: /project/gradlew cdvBuildDebug,-b,/project/build.gradle,-Dorg.gradle.daemon=true,-Dorg.gradle.jvmargs=-Xmx2048m,-Pandroid.useDeprecatedNdk=true
Error: /project/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'project'.
> Could not resolve all dependencies for configuration ':_debugApkCopy'.
> Could not find com.android.support:support-v4:27.1.0.
Required by:
project :
> Could not find com.android.support:support-v4:27.1.0.
Required by:
project :
> Could not find com.android.support:support-v4:27.1.0.
Required by:
project : > com.android.support:support-v13:23.4.0
> Could not find com.android.support:support-v4:27.1.0.
Required by:
project : > com.google.android.gms:play-services-gcm:9.8.0 > com.google.android.gms:play-services-basement:9.8.0
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
at ChildProcess.whenDone (/project/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
This is a known cordova problem when using multiple plugins that use multiple versions of gradle.
You can handle this with this plugin : https://github.com/dpa99c/cordova-android-support-gradle-release

Cordova fails to build on android (GCM dependency)

I have already installed the latest Support Repository package for Android.
However I cannot compile my new app with ionic/cordova (first build), and I get the following error:
TR: ~/Documents/bitron/B-See tommaso$ ionic run --device android
Running command: /Users/webdev1/Documents/bitron/B-See/hooks/after_prepare/010_add_platform_class.js /Users/webdev1/Documents/bitron/B-See
add to body class: platform-android
Running command: /Users/webdev1/Documents/bitron/B-See/platforms/android/cordova/run --device
ANDROID_HOME=/usr/share/java/android-sdk-macosx
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home
Running: /Users/webdev1/Documents/bitron/B-See/platforms/android/gradlew cdvBuildDebug -b /Users/webdev1/Documents/bitron/B-See/platforms/android/build.gradle -PcdvBuildArch=arm -Dorg.gradle.daemon=true
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_debugCompile'.
> Could not find any version that matches com.google.android.gms:play-services-gcm:+.
Searched in the following locations:
https://repo1.maven.org/maven2/com/google/android/gms/play-services-gcm/maven-metadata.xml
https://repo1.maven.org/maven2/com/google/android/gms/play-services-gcm/
file:/usr/share/java/android-sdk-macosx/extras/android/m2repository/com/google/android/gms/play-services-gcm/maven-metadata.xml
file:/usr/share/java/android-sdk-macosx/extras/android/m2repository/com/google/android/gms/play-services-gcm/
Required by:
:android:unspecified
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 2.769 secs
/Users/webdev1/Documents/bitron/B-See/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /Users/webdev1/Documents/bitron/B-See/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/webdev1/Documents/bitron/B-See/platforms/android/build.gradle,-PcdvBuildArch=arm,-Dorg.gradle.daemon=true
ERROR running one or more of the platforms: Error: /Users/webdev1/Documents/bitron/B-See/platforms/android/cordova/run: Command failed with exit code 1
You may not have the required environment or OS to run this project
TR: ~/Documents/bitron/B-See tommaso$
This is my plugins list:
TR: ~/Documents/bitron/B-See tommaso$ ionic plugin list
cordova-plugin-console 1.0.1 "Console"
cordova-plugin-device 1.0.1 "Device"
cordova-plugin-dialogs 1.1.1 "Notification"
cordova-plugin-file 3.0.0 "File"
cordova-plugin-inappbrowser 1.0.1 "InAppBrowser"
cordova-plugin-splashscreen 2.1.0 "Splashscreen"
cordova-plugin-statusbar 1.0.1 "StatusBar"
cordova-plugin-whitelist 1.0.0 "Whitelist"
ionic-plugin-keyboard 1.0.7 "Keyboard"
nl.x-services.plugins.toast 2.0.4 "Toast"
TR: ~/Documents/bitron/B-See tommaso$
How can I solve the problem?
In my case, this message was because of missing packages in the Android SDK, so it was required to install some packages via the Android SDK Manager.
android # To open the SDK manager
Look for:
Extras -> Google play services
Extras -> Google repository
And install them.
I solved this removing and adding the platform again.
For some reason I still had some dependecies on an old plugin I uninstalled.
According to the documentation here you need to configure the gradle build system (File: build.gradle) to install the gcm plugin functionality.
e.g:
dependencies {
compile "com.google.android.gms:play-services-gcm:8.1.0"
}
Attention: By using cordova the build.gradle file is automatically generated. That means that your additions will be lost every time you call cordova / ionic build
The cordova team advices to generate a build-extras.gradle file for custom configuration.
However, for me it is unclear how these files are merged :-( which leads to errors like that one you are facing.
Please read my consideration here to work around this problem.

Categories

Resources