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.
Related
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.
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'
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
I made an app with Construct 2 and I exported to Intel XDK. Then I exported to cordova and everytime I try to build with "cordova build android" I get this error:
ERROR: In FontFamilyFont, unable to find attribute android:t
tcIndex
FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':processDebugResources'.
com.android.ide.common.process.ProcessException: Failed to execute aapt
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: 47.337 secs
Command finished with error code 1: cmd /s /c "C:\Users\Gustavo\app\platfo
rms\android\gradlew.bat cdvBuildDebug -b C:\Users\Gustavo\app\platforms\an
droid\build.gradle -Dorg.gradle.daemon=true -Dorg.gradle.jvmargs=-Xmx2048m -Pand
roid.useDeprecatedNdk=true"
Error: cmd: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontVariationSettings
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:ttcIndex
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
It's my first time posting here, so if I am doing something wrong, please tell me.
Thanks for the help!
I got a build successful by adding this in the build-extras.gradle file:
configurations.all {
resolutionStrategy {
force 'com.android.support:support-v4:27.1.0'
}
}
And by installing the cordova-android-support-gradle-release.
Gustavo,
Its is possible that you have a conflict in cordova plugins or platform. A second possiblity is that, you have added components via npm but haven't installed it. For both scenario, I suggest that you list out the current versions installed, note them down then do an update to cordova. Here is how to list out the versions, like what I have.
cd projectfolder
$ cordova plugin
cordova-plugin-console 1.1.0 "Console"
cordova-plugin-device 2.0.1 "Device"
cordova-plugin-whitelist 1.3.3 "Whitelist"
$ cordova platform
Installed platforms:
android 7.0.0
browser 5.0.3
Available platforms:
ios ~4.5.4
osx ~4.0.1
windows ~5.0.0
www ^3.12.0
$ npm -v
3.10.10
Here is how you update cordova for the project. This example assumes you are using android platform. If you have other plugins/platform, do the necessary.
npm install
npm update
cordova platform rm android --nosave
cordova platform add android
Alternatively
cordova platform update android
If you notice a specific plugin with version error, remove and the plugin with required version.
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