Error in Building PhoneGap App - android

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

Related

Azure devops - SDK location not found. Define location with an ANDROID_SDK_ROOT environment

I get the below error while trying to run android application in a self hosted ubuntu agent. Am I getting this error because Android SDK is not present in the Ubuntu agent? If so, is there any workaround? I do not get this issue while the same app is run in a macos agent.
Any help is much appreciated
2022-07-28T23:36:24.0840286Z ##[section]Starting: Build Task
2022-07-28T23:36:24.0850273Z ==============================================================================
2022-07-28T23:36:24.0850626Z Task : Gradle
2022-07-28T23:36:24.0850911Z Description : Build using a Gradle wrapper script
2022-07-28T23:36:24.0851183Z Version : 3.205.0
2022-07-28T23:36:24.0851592Z Author : Microsoft Corporation
2022-07-28T23:36:24.0851981Z Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/build/gradle
2022-07-28T23:36:24.0852397Z ==============================================================================
2022-07-28T23:36:24.4320361Z ##[warning]Used 'chmod' method for gradlew file to make it executable.
2022-07-28T23:36:24.4933143Z [command]/azp/_work/1/s/gradlew assembleDebug
2022-07-28T23:36:25.2820472Z Starting a Gradle Daemon, 1 incompatible and 2 stopped Daemons could not be reused, use --status for details
2022-07-28T23:36:33.1825697Z
2022-07-28T23:36:33.1828123Z > Configure project :app
2022-07-28T23:36:33.1831681Z WARNING: DSL element 'android.dataBinding.enabled' is obsolete and has been replaced with 'android.buildFeatures.dataBinding'.
2022-07-28T23:36:33.1834823Z It will be removed in version 5.0 of the Android Gradle plugin.
2022-07-28T23:36:33.1836236Z VersionCode is set to 999
2022-07-28T23:36:33.1837886Z releaseVersion is set to 1.1.0
2022-07-28T23:36:33.2796793Z WARNING: DSL element 'android.dataBinding.enabled' is obsolete and has been replaced with 'android.buildFeatures.dataBinding'.
2022-07-28T23:36:33.2797944Z It will be removed in version 5.0 of the Android Gradle plugin.
2022-07-28T23:36:33.9796986Z
2022-07-28T23:36:33.9798819Z FAILURE: Build failed with an exception.
2022-07-28T23:36:33.9799385Z
2022-07-28T23:36:33.9799910Z * What went wrong:
2022-07-28T23:36:33.9801449Z A problem occurred configuring project ':app'.
2022-07-28T23:36:33.9802801Z > SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/azp/_work/1/s/local.properties'.
2022-07-28T23:36:33.9803386Z
2022-07-28T23:36:33.9803681Z * Try:
2022-07-28T23:36:33.9804986Z 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.
2022-07-28T23:36:33.9805350Z
2022-07-28T23:36:33.9805674Z * Get more help at https://help.gradle.org
2022-07-28T23:36:33.9806648Z
2022-07-28T23:36:33.9807103Z Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
2022-07-28T23:36:33.9807912Z Use '--warning-mode all' to show the individual deprecation warnings.
2022-07-28T23:36:33.9808507Z See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings
2022-07-28T23:36:33.9808801Z
2022-07-28T23:36:33.9809086Z BUILD FAILED in 9s
2022-07-28T23:36:34.4381110Z Error: The process '/azp/_work/1/s/gradlew' failed with exit code 1
2022-07-28T23:36:34.4386504Z at ExecState._setResult (/azp/_work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.205.0/node_modules/azure-pipelines-task-lib/toolrunner.js:944:25)
2022-07-28T23:36:34.4390433Z at ExecState.CheckComplete (/azp/_work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.205.0/node_modules/azure-pipelines-task-lib/toolrunner.js:927:18)
2022-07-28T23:36:34.4393277Z at ChildProcess.<anonymous> (/azp/_work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.205.0/node_modules/azure-pipelines-task-lib/toolrunner.js:840:19)
2022-07-28T23:36:34.4394910Z at ChildProcess.emit (events.js:198:13)
2022-07-28T23:36:34.4396280Z at maybeClose (internal/child_process.js:982:16)
2022-07-28T23:36:34.4397383Z at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
2022-07-28T23:36:34.4415403Z ##[error]Code analysis failed. Gradle exit code: -1. Error: Error: The process '/azp/_work/1/s/gradlew' failed with exit code 1
2022-07-28T23:36:34.4472252Z ##[section]Finishing: Build Task
SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/azp/_work/1/s/local.properties'.
The cause of this error is that the Android SDK is not installed or the Android environment is not configured on your self-hosted agent.
You need to check if Android SDK has been installed on your self-hosted agent.
If no, you can use the following command to install Android SDK.
sudo apt update && sudo apt install android-sdk
The location of Android SDK on Linux can be any of the following:
/home/AccountName/Android/Sdk
/usr/lib/android-sdk
/Library/Android/sdk/
/Users/[USER]/Library/Android/sdk
Then you can set the Android environment via setting environment variable or setting sdk.dir path in /azp/_work/1/s/local.properties.
For example:
Set environment variable
1.Edit your ~/.zshrc or ~/.bashrc or ...
2. Add SDK path:
export ANDROID_HOME=$HOME/Android/Sdk
export ANDROID_SDK_ROOT=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
3.Run command:
source $HOME/.bashrc
echo $ANDROID_SDK_ROOT

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

Problem with plugin cordova-sqlite-storage

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.

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.

PhoneGap Build won't build for Android with PushPlugin

We have a PhoneGap app which refuses to build once we add in PushPlugin.
Specifically when using PhoneGap Build we get the error:
BUILD FAILED
/home/ec2-user/android-sdk/tools/ant/build.xml:573: ../../../../../../home/ec2-user/android-sdk/com.android.support:support-v4:+ resolve to a path with no project.properties file for project /project
We can occasionally get it to build using the Ripple emulator (building in Visual Studio) after updating PhoneGap ($ npm update -g phonegap) and the PhoneGap Android Platform ($ phonegap platform update android) to the latest versions.
We have included the plugin like this:
<gap:plugin name="com.phonegap.plugins.pushplugin" />
Or, when building in Visual Studio 2015:
<vs:plugin name="com.phonegap.plugins.PushPlugin" version="2.5.0" src="https://github.com/phonegap-build/PushPlugin.git" xmlns:vs="http://schemas.microsoft.com/appx/2014/htmlapps" />
Can anyone suggest where we might be going wrong?
EDIT:
We’ve also tried building on the command line, but even after installing cordova-plugin-android-support-v4, thus;
$ cordova plugin add cordova-plugin-android-support-v4
Fetching plugin "cordova-plugin-android-support-v4" via npm
npm http GET https://registry.npmjs.org/cordova-plugin-android-support-v4
npm http 200 https://registry.npmjs.org/cordova-plugin-android-support-v4
Installing "cordova-plugin-android-support-v4" for android
we still get errors:
C:\Dev\CordovaBlank\BlankCordovaApp1\BlankCordovaApp1>cordova build android
Running command: cmd "/s /c "C:\Dev\CordovaBlank\BlankCordovaApp1\BlankCordovaApp1\platforms\android\cordova\build.bat""
ANDROID_HOME=C:\Users\XXX\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files (x86)\java\jdk1.7.0_55
Running: C:\Dev\CordovaBlank\BlankCordovaApp1\BlankCordovaApp1\platforms\android\gradlew cdvBuildDebug -b C:\Dev\CordovaBlank\BlankCordovaApp1\BlankCordova
dle.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.android.support:support-v4:+.
Searched in the following locations:
https://repo1.maven.org/maven2/com/android/support/support-v4/maven-metadata.xml
https://repo1.maven.org/maven2/com/android/support/support-v4/
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.897 secs
C:\Dev\CordovaBlank\BlankCordovaApp1\BlankCordovaApp1\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "C:\Dev\CordovaBlank\BlankCordovaApp1\BlankCordovaApp1\platforms\android\gradlew cdvBuildDebug -b C:\Dev\Cor
latforms\android\build.gradle -Dorg.gradle.daemon=true"
ERROR building one of the platforms: Error: cmd: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: cmd: Command failed with exit code 1
at ChildProcess.whenDone (C:\Users\XXX\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:134:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
NEW Push Plugin released recently.
Read this (via the Offical Blog), and get the details:
http://simonmacdonald.blogspot.com/2015/07/phonegap-plugin-push-version-111.html
UPDATE (2015-10-24): According to the Phonegap Build blog of Sept 28, 2015
Android Builds Now Using Gradle By Default.
Ant is still available, and can be force into use - with <preference name="android-build-tool" value="ant" />
Other related changes occur, including automatic minSdkVersion versioning and validation of 9-patch images. Read the blog post for details.
NOTE: On your original problem, gradle (not officially supported by phonegap) is the problem. Some people have worked around this problem, by forcing ant to run in it's place. To find those other posts, search back 30 days from this post; the subjects are similar to this and included: "Failed to build".
For PhoneGap Build, use
<gap:plugin name="com.phonegap.plugins.pushplugin" version="2.4.0" /> to force it to use the older, supported, version.
Try removing the plugin and install it via command line using this command:
cordova plugin add com.phonegap.plugins.pushplugin --save
You will notice the plugin will show in your config.xml like this:
<plugin name="com.phonegap.plugins.PushPlugin" spec="^2.2.1" />
but it won't show on the config designer, for that to happen, add "vs:" in front of the plugin tag:
<vs:plugin name="com.phonegap.plugins.PushPlugin" spec="^2.2.1" />
Try this (not 100% work, but work for me).
remove this line in platforms/android/project.properties
cordova.system.library.1=com.android.support:support-v4:+
if you are using facebook plugin (like me), you can ignore below.
cordova plugin add android.support.v4

Categories

Resources