Status: Active/relevant
Importance: BLOCKER
Reported to developer: Yes
Date reported: 20.09.2017
Date solved: N/A
Hotfix available: Yes
Category: Build
Sub-category: Android
Casued by:
plugin: phonegap-plugin-push 2.0.0 "PushPlugin"
A build error is caused by an conflict between a newer version of Google Play Services
in the Android SDK and the Cordova-plugin phonegap-plugin-push 2.0.0 "PushPlugin"
.
When building cordova build android
the following error may occur:
FAILURE: Build failed with an exception.
* Where:
Script '/Users/erlendellingsen/Documents/jobb/fearnley/fearnAppCordova/platforms/android/phonegap-plugin-push/fearnleysecurities-push.gradle' line: 38
* What went wrong:
A problem occurred evaluating root project 'android'.
> Failed to apply plugin [class 'com.google.gms.googleservices.GoogleServicesPlugin']
> For input string: "+"
* 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: 12.688 secs
Error: /Users/erlendellingsen/Documents/jobb/fearnley/fearnAppCordova/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* Where:
Script '/Users/erlendellingsen/Documents/jobb/fearnley/fearnAppCordova/platforms/android/phonegap-plugin-push/fearnleysecurities-push.gradle' line: 38
There is no permanent solution available at the time of posting, however there is a workaround.
This issue has occured to other developers as well and is discussed on Github (here). The solution to the problem is posted here.
Replace
cordova.system.library.2=com.google.android.gms:play-services-analytics:+
with
cordova.system.library.2=com.google.android.gms:play-services-analytics:11.0.1
(or some other version?)
in the file
/platforms/android/project.properties
The build should now work as intended.
I'm using ionic project. Though the above solution helps you to build without any error. I'm getting error like Cannot find module "ionic-native/push". But the PhoneGap-push plugin is already installed.