dpa99c / cordova-android-play-services-gradle-release Goto Github PK
View Code? Open in Web Editor NEWCordova/Phonegap plugin for Android to align versions of the Play Services library components specified by other plugins to a specific version.
Cordova/Phonegap plugin for Android to align versions of the Play Services library components specified by other plugins to a specific version.
I'm submitting a ... (check one with "x"):
Current behavior:
cordova create test && cd test
cordova platform add android@latest
cordova plugin add cordova-plugin-firebase --save
cordova plugin add cordova-android-play-services-gradle-release
cordova build android
BUILD FAILED in 26s
37 actionable tasks: 9 executed, 28 up-to-date
(node:15388) UnhandledPromiseRejectionWarning: Error: /home/cheb/prj/paneco/paneco-mobile/test/platforms/android/gradlew: 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.FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
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 26s
at ChildProcess.whenDone (/home/cheb/prj/paneco/paneco-mobile/test/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:15388) 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)
The build is successful until add cordova-android-play-services-gradle-release.
Expected behavior:
BUILD SUCCESSFUL
Steps to reproduce:
See the example above.
Environment information
Cordova CLI version
Cordova platform version
Plugins & versions installed in project (including this plugin)
Dev machine OS and version, e.g.
Android build issue:
Path | Version | Description | Location |
---|---|---|---|
build-tools;26.0.2 | 26.0.2 | Android SDK Build-Tools 26.0.2 | build-tools/26.0.2/ |
build-tools;27.0.3 | 27.0.3 | Android SDK Build-Tools 27.0.3 | build-tools/27.0.3/ |
emulator | 27.3.9 | Android Emulator | emulator/ |
extras;android;m2repository | 47.0.0 | Android Support Repository | extras/android/m2repository/ |
extras;google;m2repository | 58 | Google Repository | extras/google/m2repository/ |
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.2 | 1 | Solver for ConstraintLayout 1.0.2 | extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.2/ |
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2 | 1 | ConstraintLayout for Android 1.0.2 | extras/m2repository/com/android/support/constraint/constraint-layout/1.0.2/ |
patcher;v4 | 1 | SDK Patch Applier v4 | patcher/v4/ |
platform-tools | 28.0.0 | Android SDK Platform-Tools | platform-tools/ |
platforms;android-22 | 2 | Android SDK Platform 22 | platforms/android-22/ |
platforms;android-23 | 3 | Android SDK Platform 23 | platforms/android-23/ |
platforms;android-26 | 2 | Android SDK Platform 26 | platforms/android-26/ |
platforms;android-27 | 3 | Android SDK Platform 27 | platforms/android-27/ |
sources;android-22 | 1 | Sources for Android 22 | sources/android-22/ |
sources;android-26 | 1 | Sources for Android 26 | sources/android-26/ |
sources;android-27 | 1 | Sources for Android 27 | sources/android-27/ |
system-images;android-26;google_apis_playstore;x86 | 7 | Google Play Intel x86 Atom System Image | system-images/android-26/google_apis_playstore/x86/ |
system-images;android-27;google_apis;x86 | 6 | Google APIs Intel x86 Atom System Image | system-images/android-27/google_apis/x86/ |
system-images;android-27;google_apis_playstore;x86 | 3 | Google Play Intel x86 Atom System Image | system-images/android-27/google_apis_playstore/x86/ |
system-images;android-28;google_apis;x86 | 4 | Google APIs Intel x86 Atom System Image | system-images/android-28/google_apis/x86/ |
tools | 26.1.1 | Android SDK Tools | tools/ |
Console output
FAILURE: Build failed with an exception.
java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
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 19s
37 actionable tasks: 1 executed, 36 up-to-date
(node:17831) UnhandledPromiseRejectionWarning: Error: /home/cheb/prj/paneco/paneco-mobile/test/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
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 19s
at ChildProcess.whenDone (/home/cheb/prj/paneco/paneco-mobile/test/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:17831) 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:17831) [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.
Hello,
I do not understand how this plugin works since I'm unable to see it work.
When does this changes the versions? only during installations? Do I need to remove/add every time I want to set variables?
Thank you!
I'm submitting a ... (check one with "x"):
Current behavior:
Last version of this plugin is not honoring --variable PLAY_SERVICES_VERSION. Builds are using default 15.+ version.
See final paragraph of steps to reproduce.
Expected behavior:
PLAY_SERVICES_VERSION variable should be honored.
Steps to reproduce:
I have added this plugin with this command:
ionic cordova plugin add cordova-android-play-services-gradle-release --variable PLAY_SERVICES_VERSION=11+.
I can see the variable saved in config.xml. But when building the app I can see this log
cordova-android-play-services-gradle-release.after-prepare: Wrote custom version '11+' to ......../platforms/android/build.gradle
cordova-android-play-services-gradle-release.before-prepare: Wrote custom version '11+' to ....../platforms/android/cordova-android-play-services-gradle-release/properties.gradle
Android Studio project detected
cordova-android-play-services-gradle-release.after-prepare: Wrote custom version '11+' to ...../platforms/android/build.gradle
Preparing Firebase on Android
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.
+-----------------------------------------------------------------
| cordova-android-play-services-gradle-release: 15.+
+-----------------------------------------------------------------
If I check those files I can see that script has indeed wrote custom version correctly, but the build is still using 15.+ (default).
The build properly uses this custom version if I open the gradle script and write
def PLAY_SERVICES_VERSION = "11.+"
Environment information
cli packages:
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
@ionic/app-scripts : 3.1.9
Cordova Platforms : android 7.1.0
Ionic Framework : ionic-angular 3.8.0
System:
Android SDK Tools : 26.1.1
Node : v6.14.1
npm : 3.10.10
OS : Linux 4.13
cordova@9
no longer writes plugin config to config.xml
by default so this plugin needs updating to read plugin info from package.json
.
I'm submitting a ... (check one with "x"):
Current behavior:
cordova build
will still trying to fetch the original version see this error message:> Could not find play-services-basement.aar (com.google.android.gms:play-services-basement:15.0.1).
Searched in the following locations:
https://jcenter.bintray.com/com/google/android/gms/play-services-basement/15.0.1/play-services-basement-15.0.1.aar
Expected behavior:
cordova build
should install the version specified by the variable PLAY_SERVICES_VERSIONSteps to reproduce:
npm install -g [email protected]
cordova create cordova-8-android-6
cd cordova-8-android-6
cordova plugin add cordova-plugin-request-location-accuracy
cordova plugin add cordova-android-play-services-gradle-release --variable PLAY_SERVICES_VERSION=15.0.0
cordova platform add [email protected]
cordova build android
Environment information
Android build issue:
sdkmanager --list | sed -e '/Available Packages/q'
Related code:
npm install -g [email protected]
cordova create cordova-8-android-6
cd cordova-8-android-6
cordova plugin add cordova-plugin-request-location-accuracy
cordova plugin add cordova-android-play-services-gradle-release --variable PLAY_SERVICES_VERSION=15.0.0
cordova platform add [email protected]
cordova build android
Console output
Adding cordova-plugin-request-location-accuracy to package.json
Saved plugin info for "cordova-plugin-request-location-accuracy" to config.xml
Adding cordova-android-play-services-gradle-release to package.json
Saved plugin info for "cordova-android-play-services-gradle-release" to config.xml
Using cordova-fetch for [email protected]
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms/android
Package: io.cordova.hellocordova
Name: HelloCordova
Activity: MainActivity
Android target: android-26
Subproject Path: CordovaLib
Android project created with [email protected]
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Installing "cordova-plugin-whitelist" 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.
Adding cordova-plugin-whitelist to package.json
Saved plugin info for "cordova-plugin-whitelist" to config.xml
Discovered plugin "cordova-plugin-request-location-accuracy" in config.xml. Adding it to the project
Installing "cordova-plugin-request-location-accuracy" for android
Subproject Path: CordovaLib
Adding cordova-plugin-request-location-accuracy to package.json
Saved plugin info for "cordova-plugin-request-location-accuracy" to config.xml
Discovered plugin "cordova-android-play-services-gradle-release" in config.xml. Adding it to the project
Installing "cordova-android-play-services-gradle-release" for android
cordova-android-play-services-gradle-release: Android platform: V6
cordova-android-play-services-gradle-release: Wrote custom version '15.0.0' to /Users/dboho/experiments/cordova-example/cordova-8-1-2/platforms/android/build.gradle
cordova-android-play-services-gradle-release: Wrote custom version '15.0.0' to /Users/dboho/experiments/cordova-example/cordova-8-1-2/platforms/android/cordova-android-play-services-gradle-release/properties.gradle
Adding cordova-android-play-services-gradle-release to package.json
Saved plugin info for "cordova-android-play-services-gradle-release" to config.xml
cordova-android-play-services-gradle-release: Android platform: V6
cordova-android-play-services-gradle-release: Wrote custom version '15.0.0' to /Users/dboho/experiments/cordova-example/cordova-8-1-2/platforms/android/build.gradle
cordova-android-play-services-gradle-release: Wrote custom version '15.0.0' to /Users/dboho/experiments/cordova-example/cordova-8-1-2/platforms/android/cordova-android-play-services-gradle-release/properties.gradle
--save flag or autosave detected
Saving android@~6.4.0 into config.xml file ...
cordova-android-play-services-gradle-release: Android platform: V6
cordova-android-play-services-gradle-release: Wrote custom version '15.0.0' to /Users/dboho/experiments/cordova-example/cordova-8-1-2/platforms/android/build.gradle
cordova-android-play-services-gradle-release: Wrote custom version '15.0.0' to /Users/dboho/experiments/cordova-example/cordova-8-1-2/platforms/android/cordova-android-play-services-gradle-release/properties.gradle
cordova-android-play-services-gradle-release: Android platform: V6
cordova-android-play-services-gradle-release: Wrote custom version '15.0.0' to /Users/dboho/experiments/cordova-example/cordova-8-1-2/platforms/android/build.gradle
cordova-android-play-services-gradle-release: Wrote custom version '15.0.0' to /Users/dboho/experiments/cordova-example/cordova-8-1-2/platforms/android/cordova-android-play-services-gradle-release/properties.gradle
ANDROID_HOME=/Users/dboho/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home
Parallel execution is an incubating feature.
:wrapper
BUILD SUCCESSFUL in 0s
1 actionable task: 1 executed
Subproject Path: CordovaLib
Parallel execution is an incubating feature.
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_759f271iwkml710t2aaju8enm.run(/Users/dboho/experiments/cordova-example/cordova-8-1-2/platforms/android/build.gradle:141)
Configuration 'compile' in project ':' is deprecated. Use 'implementation' instead.
publishNonDefault is deprecated and has no effect anymore. All variants are now published.
:preBuild UP-TO-DATE
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest
:prepareLintJar
:generateDebugResValues
:createDebugCompatibleScreenManifests
:splitsDiscoveryTaskDebug
:mergeDebugShaders
:compileDebugShaders
:generateDebugAssets
:mergeDebugJniLibFolders
:CordovaLib:processDebugManifest
:validateSigningDebug
:preDebugBuild
:CordovaLib:compileDebugAidl
:CordovaLib:packageDebugRenderscript NO-SOURCE
:CordovaLib:compileDebugRenderscript
:CordovaLib:generateDebugResValues
:CordovaLib:generateDebugResources
:CordovaLib:packageDebugResources
:CordovaLib:platformAttrExtractor
:CordovaLib:generateDebugBuildConfig
:preDebugBuild FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':debugCompileClasspath'.
> Could not find play-services-basement.aar (com.google.android.gms:play-services-basement:15.0.1).
Searched in the following locations:
https://jcenter.bintray.com/com/google/android/gms/play-services-basement/15.0.1/play-services-basement-15.0.1.aar
* 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
17 actionable tasks: 17 executed
/Users/dboho/experiments/cordova-example/cordova-8-1-2/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':debugCompileClasspath'.
> Could not find play-services-basement.aar (com.google.android.gms:play-services-basement:15.0.1).
Searched in the following locations:
https://jcenter.bintray.com/com/google/android/gms/play-services-basement/15.0.1/play-services-basement-15.0.1.aar
* 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
I'm submitting a ... (check one with "x"):
Current behavior:
I recently added cordova-android-play-services-gradle-release to a project containing cordova-android-support-gradle-release (due to play service 12.0 issue, came here through this SO answer).
When I run cordova build android
, I get following error :
------------------------------------------------------------------------------------------
Copying notification icon resources to android resources directory...
------------------------------------------------------------------------------------------
cordova-android-play-services-gradle-release PLAY_SERVICES_VERSION: 11.8.0
cordova-android-support-gradle-release ANDROID_SUPPORT_VERSION: 25.+
notification_icon resources copied !
cordova-android-play-services-gradle-release : WROTE /path/to/my/project/platforms/android/build.gradle > 11.8.0
cordova-android-support-gradle-release : WROTE /path/to/my/project/platforms/android/build.gradle > 25.+
ANDROID_HOME=/Users/fcamblor/tools/homebrew/Cellar/android-sdk/24.4.1_1
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
Reading build config file: /path/to/my/project/build.json
Reading the keystore from: /path/to/my/project/certs/cma-key.jks
Subproject Path: CordovaLib
FAILURE: Build failed with an exception.
* Where:
Build file '/path/to/my/project/platforms/android/build.gradle' line: 322
* What went wrong:
Could not compile build file '/path/to/my/project/platforms/android/build.gradle'.
> startup failed:
build file '/path/to/my/project/platforms/android/build.gradle': 322: unexpected token: ( @ line 322, column 1.
()
^
1 error
* 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: 0.734 secs
Error: /path/to/my/project/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* Where:
Build file '/path/to/my/project/platforms/android/build.gradle' line: 322
build.gradle file is looking like :
for (def func : cdvPluginPostBuildExtras) {
func()
}
// This can be defined within build-extras.gradle as:
// ext.postBuildExtras = { ... code here ... }
if (hasProperty('postBuildExtras')) {
postBuildExtras()
}
()
}
()
}
I suspect there are some conflict between plugins collaborating to build.gradle (see my cordova plugins list below)
Expected behavior:
No build.gradle code generation resulting into compilation errors
Environment information
Installed platforms:
android 6.2.3
browser 4.1.0
ios 4.5.2
cordova-android-play-services-gradle-release 1.2.1 "cordova-android-play-services-gradle-release"
cordova-android-support-gradle-release 1.2.1 "cordova-android-support-gradle-release"
cordova-background-geolocation 2.7.3 "BackgroundGeolocation"
cordova-custom-config 2.0.3 "cordova-custom-config"
cordova-plugin-background-fetch 5.1.1 "CDVBackgroundFetch"
cordova-plugin-cocoalumberjack 0.0.4 "CocoaLumberjack"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-device 1.1.2 "Device"
cordova-plugin-dialogs 1.3.3 "Notification"
cordova-plugin-geolocation 2.4.3 "Geolocation"
cordova-plugin-google-analytics 1.7.11 "Google Universal Analytics Plugin"
cordova-plugin-inappbrowser 1.7.0 "InAppBrowser"
cordova-plugin-network-information 1.2.1 "Network Information"
cordova-plugin-request-location-accuracy 2.2.2 "Request Location Accuracy"
cordova-plugin-splashscreen 3.2.2 "Splashscreen"
cordova-plugin-statusbar 2.1.3 "StatusBar"
cordova-plugin-whitelist 1.3.2 "Whitelist"
cordova.plugins.diagnostic 3.7.0 "Diagnostic"
phonegap-plugin-barcodescanner 6.0.4 "BarcodeScanner"
ProductName: Mac OS X
ProductVersion: 10.12.6
BuildVersion: 16G1114
Other information:
https://stackoverflow.com/a/49431381
dpa99c/cordova-android-support-gradle-release#18
dpa99c/cordova-android-support-gradle-release#19
Regards,
I was unable to install your plugin when I ran phonegap plugin add cordova-android-play-services-gradle-release
.
Failed to install 'cordova-android-play-services-gradle-release': Error: /Users/banana-man/my-projects/preview/platforms/android/gradlew: Command failed with exit code 1
at ChildProcess.whenDone (/Users/banana-man/my-projects/preview/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
at emitTwo (events.js:125:13)
at ChildProcess.emit (events.js:213:7)
at maybeClose (internal/child_process.js:927:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
Error: /Users/banana-man/my-projects/preview/platforms/android/gradlew: Command failed with exit code 1
Hi, I'm the author of a few cordova and react-native plugins. I've been struggling with the best way to solve play-services dependences myself for years.
While reading Gradle Dependency Resolution, I found myself here.
I've tweaked your script a bit:
I'm not sure what this does, I've left it out of my script.
// This will be important for google APIs 11.2.*, since they're now hosted at Maven
repositories{
maven {
url 'https://maven.google.com'
}
}
////
// Enter your desired google API version for all dependencies
// Would be nice to somehow make this configurable via <preference /> in plugin.xml
// Would require a <hook /> script to edit this file.
//
def GOOGLE_API_VERSION = '11.2.0';
////
// List of play-services libs to search for.
// Here's a list of all Google APIs: https://developers.google.com/android/reference/packages
def GOOGLE_APIS = [
'com.google.android.gms',
'com.google.firebase'
]
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.group in GOOGLE_APIS) {
details.useVersion GOOGLE_API_VERSION
}
}
}
Until yesterday it was working fine. today it download new packages and then failed.
/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
!zip.isFile()
Please help. Thanks.
If i don't have any plugin which needs to be configured in the config.xml, cordova-android-play-services-gradle-release
produces an error
Error: Cannot read property 'length' of undefined
Please have a look at scripts/before-prepare.js#15
of the current release version where plugins
also can be undefined.
thx
What do I add at the bottom of build.gradle by recommendation of this plugin like below?
google-services plugin could not detect any version for com.google.android.gms or com.google.firebase, default version: 9.0.0 will be used.
please apply google-services plugin at the bottom of the build file.
+-----------------------------------------------------------------
| cordova-android-play-services-gradle-release: 15.+
+----------------------------------------------------------------
I'm submitting a ... (check one with "x"):
Hello @dpa99c , first of all, I want to congratulate you on your excellent work doing this amazing plugin. That's why my first recommendation is the option of being able to give a beer.
The current problem is that very often we find the error of play-services-X is being requested by several other libraries at [[15.x1,15.x2]], but resolves to 15.x3. Still using your plugin and put 15. + to be synchronized with the version of the other plugins continues to be this fearsome error.
When you are the creator of this excellent plugin it is noted that you are the expert in the theme of configuring and aligning the versions of google play services in a single one and thus avoid this annoying problem.
That's why I think you're the only one who could help everyone with a guide or how to set the version of each google android.gms: play-services-X that the user needs that we can establish each version for each subpart of google android.gms: play-services and align it with the other versions of the other plugins that we have installed in our application.
For example to be able to put these or other version variables:
com.google.android.gms: play-services-auth: 16.0.1
com.google.android.gms: play-services-base: 16.1.0
com.google.android.gms: play-services-identity: 16.0.0
com.google.android.gms: play-services-analytics: 16.0.8
the same for your firebase plugin, to be able to set the version:
com.google.firebase: firebase-analytics: 16.5.0
com.google.firebase: firebase-crash: 16.2.1
It should be noted that I already tried 2 things, using the 16. + the same error of play-services still appears-X is being requested by several other libraries at [[15.x1,15.x2]], but resolves to 15.x3.
Also, I already try to set a specific version in --variable PLAY_SERVICES_VERSION = 15.x2 tells me that it does not find the other elements in that version 15.x2.
Please help us with that big headache, you're the expert on the subject.
I'm trying to align version to build a corova app using cordova-plugin-fcm and cordova-plugin-health
This similar issue point to your project
dpa99c/cordova-plugin-request-location-accuracy#21
But it does not seem to help
Steps to the error
$ cordova create bg2
$ cd bg2
$ cordova platform add android
I drop google-services.json and GoogleService-Info.plist files to the bg2 folder
I change io.cordova.hellocordova to my app Id in confix.xml
$ cordova plugin add cordova-plugin-fcm
$ cordova plugin add cordova-plugin-health
$ cordova plugin add cordova-android-play-services-gradle-release
$ cordova build android
and still the same error
Error: /Users/eimbernon/bg2/platforms/android/gradlew: 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.
FAILURE: Build failed with an exception.
Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 9.0.0.
I'm submitting a ... (check one with "x"):
Current behavior:
I cannot re-add the plugin after removing it.
Expected behavior:
Remove the plugin with cordova plugin remove cordova-android-play-services-gradle-release
and re-add it with cordova plugin add cordova-android-play-services-gradle-release
Steps to reproduce:
cordova plugin list
that it's removed.Environment information
➜ app cordova -v
8.0.0
➜ app cordova platform ls
Installed platforms:
android 7.0.0
ios 4.5.5
Available platforms:
browser ~5.0.1
osx ~4.0.1
windows ~5.0.0
www ^3.12.0
➜ app cordova plugin ls
com.googlemaps.ios 2.7.0 "Google Maps SDK for iOS"
cordova-android-play-services-gradle-release 1.4.3 "cordova-android-play-services-gradle-release"
cordova-open-native-settings 1.5.1 "Native settings"
cordova-plugin-buildinfo 2.0.2 "BuildInfo"
cordova-plugin-customurlscheme 4.3.0 "Custom URL scheme"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-dialogs 2.0.1 "Notification"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-google-analytics 1.8.6 "Google Universal Analytics Plugin"
cordova-plugin-inappbrowser 3.0.0 "InAppBrowser"
cordova-plugin-network-information 2.0.1 "Network Information"
cordova-plugin-request-location-accuracy 2.2.3 "Request Location Accuracy"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-plugin-x-toast 2.7.0 "Toast"
cordova.plugins.diagnostic 4.0.5 "Diagnostic"
onesignal-cordova-plugin 2.4.3 "OneSignal Push Notifications"
➜ app
Other information:
cordova plugin add cordova-android-play-services-gradle-release --variable PLAY_SERVICES_VERSION=15.+
Installing "cordova-android-play-services-gradle-release" for android
Android Studio project detected
Error during processing of action! Attempting to revert...
Failed to install 'cordova-android-play-services-gradle-release': CordovaError: Uh oh!
"/Users/spinninghamster/Code/Live/Apps/app/platforms/android/cordova-android-play-services-gradle-release/properties.gradle" already exists!
at copyNewFile (/Users/spinninghamster/Code/Live/Apps/app/platforms/android/cordova/lib/pluginHandlers.js:261:45)
at install (/Users/spinninghamster/Code/Live/Apps/app/platforms/android/cordova/lib/pluginHandlers.js:51:17)
at ActionStack.process (/Users/spinninghamster/Code/Live/Apps/app/platforms/android/cordova/node_modules/cordova-common/src/ActionStack.js:56:25)
at PluginManager.doOperation (/Users/spinninghamster/Code/Live/Apps/app/platforms/android/cordova/node_modules/cordova-common/src/PluginManager.js:114:20)
at PluginManager.addPlugin (/Users/spinninghamster/Code/Live/Apps/app/platforms/android/cordova/node_modules/cordova-common/src/PluginManager.js:144:17)
at /Users/spinninghamster/Code/Live/Apps/app/platforms/android/cordova/Api.js:247:74
at _fulfilled (/Users/spinninghamster/Code/Live/Apps/app/platforms/android/cordova/node_modules/q/q.js:854:54)
at self.promiseDispatch.done (/Users/spinninghamster/Code/Live/Apps/app/platforms/android/cordova/node_modules/q/q.js:883:30)
at Promise.promise.promiseDispatch (/Users/spinninghamster/Code/Live/Apps/app/platforms/android/cordova/node_modules/q/q.js:816:13)
at /Users/spinninghamster/Code/Live/Apps/app/platforms/android/cordova/node_modules/q/q.js:570:49
(node:9692) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): CordovaError: Uh oh!
"/Users/spinninghamster/Code/Live/Apps/app/platforms/android/cordova-android-play-services-gradle-release/properties.gradle" already exists!
(node:9692) [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.
Hi Dave, thanks for trying to fix this issue. Unfortunately when using your plugin I'm still facing the dreaded dependency hell. Here's the stack trace I get when doing cordova build android:
Found com.google.android.gms:play-services-location:11.6.0, but version 11.6.2 is needed for the google-services plugin.
:processReleaseGoogleServices FAILED
FAILURE: Build failed with an exception.
Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 11.6.2.
Here's my plugins:
cordova plugins list
cordova-android-play-services-gradle-release 1.2.0 "cordova-android-play-services-gradle-release"
cordova-background-geolocation 2.10.1 "BackgroundGeolocation"
cordova-google-api-version 0.0.1 "cordova-google-api-version"
cordova-plugin-actionsheet 2.3.3 "ActionSheet"
cordova-plugin-background-fetch 5.2.1 "CDVBackgroundFetch"
cordova-plugin-cocoalumberjack 0.0.4 "CocoaLumberjack"
cordova-plugin-console 1.1.0 "Console"
cordova-plugin-device 1.1.7 "Device"
cordova-plugin-dialogs 1.3.4 "Notification"
cordova-plugin-ionic 3.1.2 "IonicCordova"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2-dev "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
ionic-plugin-deeplinks 1.0.15 "Ionic Deeplink Plugin"
phonegap-plugin-push 2.1.3 "PushPlugin"
uk.co.workingedge.phonegap.plugin.launchnavigator 4.1.3 "Launch Navigator"
Let me know if there's any extra information I can provide that might help.
I'm submitting a ... (check one with "x"):
Current behavior:
When I run ionic cordova platform add [email protected]
, the plugin is installing with android version 7 instead, with the following error:
npm install of external dependencies ok
cordova-android-play-services-gradle-release: Android platform: cordova-android@7
cordova-android-play-services-gradle-release: ERROR: EXCEPTION: Error: ENOENT: no such file or directory, open 'W:\app\platforms\android\app\build.gradle'
cordova-android-support-gradle-release: Android platform: cordova-android@7
cordova-android-support-gradle-release: ERROR: EXCEPTION: Error: ENOENT: no such file or directory, open 'W:\app\platforms\android\app\build.gradle'
--save flag or autosave detected
Saving android@~6.4.0 into config.xml file ...
I suspected this is because of the function getCordovaAndroidVersion
is assuming android version 7 based on the existence of the path platforms/android/app/src
. The folder might be created by another plugin I have installed. I'm not sure if this is the standard to version detect as i'm not well versed with Cordova ecosystem, but I'd like to think that there should be a better failsafe way to determine the version. If you have any pointers I would love to make a PR.
Steps to reproduce:
ionic cordova platform add [email protected]
Environment information
7.1.0
6.4.0
cordova-android-play-services-gradle-release 1.4.1 "cordova-android-play-services-gradle-release"
cordova-android-support-gradle-release 1.4.2 "cordova-android-support-gradle-release"
cordova-plugin-advanced-http 1.11.1 "Advanced HTTP plugin"
cordova-plugin-camera 4.0.3 "Camera"
cordova-plugin-crosswalk-webview 2.4.0 "Crosswalk WebView Engine"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-fcm 2.1.2 "FCMPlugin"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-googlemaps 2.3.4 "cordova-plugin-googlemaps"
cordova-plugin-ionic-keyboard 2.1.2 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 1.2.1 "cordova-plugin-ionic-webview"
cordova-plugin-network-information 2.0.1 "Network Information"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-telerik-imagepicker 2.2.0 "ImagePicker"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-sqlite-storage 2.3.2 "Cordova sqlite storage plugin"
Version 1709 (OS Build 16299.431)
Android build issue:
v6.9.4
com.android.tools.build:gradle:3.0.0
android:targetSdkVersion
in AndroidManifest.xml
: 26
If using an Ionic Native Typescript wrapper for this plugin:
cli packages: (C:\Users\User\AppData\Roaming\npm\node_modules)
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : 7.1.0
local packages:
@ionic/app-scripts : 3.1.8
Cordova Platforms : none
Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 26.1.1
Node : v6.9.4
npm : 3.10.10
OS : Windows 10
Environment Variables:
ANDROID_HOME : C:\Users\User\AppData\Local\Android\Sdk
Misc:
backend : pro
+-- @ionic-native/[email protected]
+-- @ionic-native/[email protected]
+-- @ionic-native/[email protected]
+-- @ionic-native/[email protected]
+-- @ionic-native/[email protected]
+-- @ionic-native/[email protected]
+-- @ionic-native/[email protected]
+-- @ionic-native/[email protected]
+-- @ionic-native/[email protected]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.