Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Build Issue Android #1460

Closed
dezudas opened this issue Dec 14, 2016 · 10 comments
Closed

Build Issue Android #1460

dezudas opened this issue Dec 14, 2016 · 10 comments

Comments

@dezudas
Copy link

dezudas commented Dec 14, 2016

Expected Behaviour

Build/Compilation success

Actual Behaviour

compilation broken for android platform

Reproduce Scenario (including but not limited to)

update the cordova platfrom and plugin to latest and build the app 

Steps to Reproduce

cordova build android -d

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

(Android) What device vendor (e.g. Samsung, HTC, Sony...)

All

Cordova CLI version and cordova platform version

cordova --version                                    6.4.0
cordova platform version android                     6.1.0

Plugin version

cordova plugin version | grep phonegap-plugin-push  2.0.0-rc1

Sample Push Data Payload

Sample Code that illustrates the problem

cordova build android -d

Logs taken while reproducing problem

Executing script found in config.xml for hook "before_build": scripts/copy_resource_files.js
No scripts found for hook "before_prepare".
Checking config.xml for saved platforms that haven't been added to the project
Checking for any plugins added to the project that have not been installed in android platform
No differences found between plugins added to project and installed in android platform. Continuing...
Generating platform-specific config.xml from defaults for android at /Users/dijup/mobileapp/chordpedia/platforms/android/res/xml/config.xml
Merging project's config.xml into platform-specific android config.xml
Merging and updating files from [www, platforms/android/platform_www] to platforms/android/assets/www
Wrote out android application name "Chordpedia" to /Users/dijup/mobileapp/chordpedia/platforms/android/res/values/strings.xml
Wrote out Android package name "com.dez.chordpedia" to /Users/dijup/mobileapp/chordpedia/platforms/android/src/com/dez/chordpedia/MainActivity.java
Updating icons at platforms/android/res
Updating splash screens at platforms/android/res
Prepared android project successfully
Executing script found in hooks directory for hook "after_prepare": hooks/after_prepare/uglify.js
Running command: /Users/dijup/mobileapp/chordpedia/hooks/after_prepare/uglify.js /Users/dijup/mobileapp/chordpedia
Command finished with error code 0: /Users/dijup/mobileapp/chordpedia/hooks/after_prepare/uglify.js /Users/dijup/mobileapp/chordpedia
Checking config.xml for saved plugins that haven't been added to the project
No scripts found for hook "before_compile".
ANDROID_HOME=/Users/dijup/Development/sdk/
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home
Reading build config file: /Users/dijup/mobileapp/chordpedia/build.json
Reading the keystore from: /Users/dijup/mobileapp/chordpedia/chordpedia.keystore
Subproject Path: CordovaLib
Running command: /Users/dijup/mobileapp/chordpedia/platforms/android/gradlew cdvBuildDebug -b /Users/dijup/mobileapp/chordpedia/platforms/android/build.gradle -Dorg.gradle.daemon=true -Dorg.gradle.jvmargs=-Xmx2048m -Pandroid.useDeprecatedNdk=true

FAILURE: Build failed with an exception.

  • Where:
    Script '/Users/dijup/mobileapp/chordpedia/platforms/android/phonegap-plugin-push/chordpedia-push.gradle' line: 12

  • What went wrong:
    A problem occurred evaluating root project 'android'.

Failed to apply plugin [id 'com.google.gms.google-services']
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: 0.771 secs
Command finished with error code 1: /Users/dijup/mobileapp/chordpedia/platforms/android/gradlew cdvBuildDebug,-b,/Users/dijup/mobileapp/chordpedia/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Dorg.gradle.jvmargs=-Xmx2048m,-Pandroid.useDeprecatedNdk=true
Error: /Users/dijup/mobileapp/chordpedia/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

  • Where:
    Script '/Users/dijup/mobileapp/chordpedia/platforms/android/phonegap-plugin-push/chordpedia-push.gradle' line: 12

  • What went wrong:
    A problem occurred evaluating root project 'android'.

Failed to apply plugin [id 'com.google.gms.google-services']
For input string: "+"

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    at ChildProcess.whenDone (/Users/dijup/mobileapp/chordpedia/platforms/android/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 Socket. (internal/child_process.js:334:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:493:12)
@dezudas dezudas changed the title Build Issue Android and IOS Build Issue Android Dec 14, 2016
@macdonst
Copy link
Member

@dezudas thanks for the bug report. Oddly enough I had a similar problem with the FCM library complaining about the + in the input stream which is why I pinned it to 9.8.0. I'll look at doing the same for com.google.gms.google-services.

@macdonst macdonst added this to the Release 2.0.0 milestone Dec 14, 2016
@macdonst
Copy link
Member

@dezudas can you try installing the latest from master? You'll need to make sure you have the 25.1.0 support library installed.

@dezudas
Copy link
Author

dezudas commented Dec 16, 2016

@macdonst thank you! issue has been resolved,

phonegap-plugin-push 1.9.2 "PushPlugin"

@alonsovb
Copy link

I'm having the exact same problem when trying to build android.

$ cordova --version
6.4.0

$ cordova platform version android
Installed platforms:
  android 6.1.1

$ cordova plugin version | grep phonegap-plugin-push
phonegap-plugin-push 2.0.0-rc2 "PushPlugin"

I get this message after running ionic build android:

BUILD FAILED

Total time: 3 mins 50.947 secs
Error: /Users/alonso/Work/ElArtesanoApp/artesanoapp-develop/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* Where:
Script '/Users/alonso/Work/ElArtesanoApp/artesanoapp-develop/platforms/android/phonegap-plugin-push/elArtesanoApp-push.gradle' line: 12

* What went wrong:
A problem occurred evaluating root project 'android'.
> Failed to apply plugin [id 'com.google.gms.google-services']
   > For input string: "+"

@kirillgroshkov
Copy link

+1, exactly same error message, same versions

@Honorato
Copy link

@alonsovb and @kirillgroshkov, I solved it (actually it is a workaround, I didn't figured out how to really solve it) by editing the file platforms/android/project.properties, according to this post http://stackoverflow.com/questions/41408514/com-google-android-gms-common-internal-safe-parcel-safe-parcelable-not-found.

I said it's a workaround because this file is generated every time we add the android platform.

Hope it helps.

@amritk
Copy link

amritk commented May 9, 2017

Having the same problem on android as well

$ cordova --version 
7.0.0
$ cordova platform version android
Installed platforms:
  android 6.2.3
  ios 4.4.0
$ cordova plugin version | grep phonegap-plugin-push
phonegap-plugin-push 2.0.0-rc3 "PushPlugin"
$ cordova build android --stacktrace
cordova-custom-config: Skipping auto-restore of config file backup(s)
ANDROID_HOME=/Users/amritk/Library/android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home
Subproject Path: CordovaLib
null
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_c3puixypsoru4vva0jcuf0azz.run(/Users/amritk/apps/cordova/platforms/android/build.gradle:140)
org.xwalk:xwalk_core_library:23+

FAILURE: Build failed with an exception.

* Where:
Script '/Users/amritk/apps/cordova/platforms/android/phonegap-plugin-push/hc_app-push.gradle' line: 12

* What went wrong:
A problem occurred evaluating root project 'android'.
> Failed to apply plugin [id 'com.google.gms.google-services']
   > 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: 2.16 secs
Error: /Users/amritk/apps/cordova/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* Where:
Script '/Users/amritk/apps/cordova/platforms/android/phonegap-plugin-push/hc_app-push.gradle' line: 12

* What went wrong:
A problem occurred evaluating root project 'android'.
> Failed to apply plugin [id 'com.google.gms.google-services']
   > For input string: "+"

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

The workaround mentioned above did not work, going to go back to a 1.x version for now

macdonst added a commit that referenced this issue May 25, 2017
* Added partial Android FCM support (#975)

* Modified plugin.xml to include FCM changes

* Plugin.xml changes for FCM

* Java changes for FCM

* Increased plugin version to 2.0.0

* Increased plugin version in package.json

* Added topic subscription/unsubscription

* Removed some empty lines

* Fixed empty token on android first run (#1008)

* Removed GCM files and added FCM files

* Added .framework files as custom frameworks

* Changed code to work with FCM

* Added hook and resource file to copy GoogleService-Info.plist

* fixed registration and removed unused code

* Use CocoaPods

* Fix rebase errors

* Fix topic subscription and unsubscription on FCM

* Refactor GCMIntentService to FCMService

* Issue #689: Remove sender id from PushNotification init Android options

* Issue #689: Remove sender id from PushNotification init iOS options

* 📝 Update to using fcm-node

* 🐛 Issue #1188: Strings.xml google_app_id conflict with google-services.json

* Add empty google services plist

* Pin FCM to 9.8.0

* 🔧 Add browser platform back for FCM branch

* 🔨🔧⬆️ Use Babel to transpile ES2015 code

* 🔧 add tern to gitignore

* 🔖 Bumping plugin version to 2.0.0-rc1

* 2.0.0-rc1

* Updating CHANGELOG

* Fixing my merge error for PR #1378 Optional event emit instead of function call for action buttons

* 🐛🍎 Issue #1461: App crashes when initialising with topics (v2.0.0-rc1)

* 🐛🐧📝⬆️ #1460: Build Issue Android

* 🐛🍎🔧 Fixing a merge issue where aps-environment was accidentally removed

* 🐧📝🐛 Issue #1470: Cannot install phonegap-plugin-push on master

* 📝 Using a newer version on the examples

* 🍎🐛 Issue #1497: App crashes after refreshing when using FCM (v2)

* Bumping plugin version to 2.0.0-rc2

* 2.0.0-rc2

* Updating CHANGELOG

* Added partial Android FCM support (#975)

* Modified plugin.xml to include FCM changes

* Plugin.xml changes for FCM

* Java changes for FCM

* Increased plugin version to 2.0.0

* Increased plugin version in package.json

* Added topic subscription/unsubscription

* Removed some empty lines

* Removed GCM files and added FCM files

* Changed code to work with FCM

* Added hook and resource file to copy GoogleService-Info.plist

* Use CocoaPods

* Fix rebase errors

* Issue #689: Remove sender id from PushNotification init Android options

* 🐛 Issue #1188: Strings.xml google_app_id conflict with google-services.json

* Pin FCM to 9.8.0

* 🔧 Add browser platform back for FCM branch

* 🔨🔧⬆️ Use Babel to transpile ES2015 code

* 🔧 add tern to gitignore

* 🔖 Bumping plugin version to 2.0.0-rc1

* 🐛🐧📝⬆️ #1460: Build Issue Android

* Bumping plugin version to 2.0.0-rc2

* Added partial Android FCM support (#975)

* Modified plugin.xml to include FCM changes

* Plugin.xml changes for FCM

* Java changes for FCM

* Increased plugin version to 2.0.0

* Increased plugin version in package.json

* Added topic subscription/unsubscription

* Removed some empty lines

* Removed GCM files and added FCM files

* Added hook and resource file to copy GoogleService-Info.plist

* Use CocoaPods

* Fix rebase errors

* 🐛 Issue #1188: Strings.xml google_app_id conflict with google-services.json

* Updating CHANGELOG

* ✏️ fixing error in CHANGELOG

* Bumping plugin version to 2.0.0-rc2

* Updating CHANGELOG

* Added partial Android FCM support (#975)

* Modified plugin.xml to include FCM changes

* Plugin.xml changes for FCM

* Java changes for FCM

* Increased plugin version to 2.0.0

* Increased plugin version in package.json

* Added topic subscription/unsubscription

* Removed some empty lines

* Removed GCM files and added FCM files

* Changed code to work with FCM

* Added hook and resource file to copy GoogleService-Info.plist

* fixed registration and removed unused code

* Use CocoaPods

* Fix rebase errors

* Issue #689: Remove sender id from PushNotification init Android options

* Issue #689: Remove sender id from PushNotification init iOS options

* 🐛 Issue #1188: Strings.xml google_app_id conflict with google-services.json

* 🔧 add tern to gitignore

* 🔖 Bumping plugin version to 2.0.0-rc1

* Bumping plugin version to 2.0.0-rc2

* Remove hook and use resource-file tag to copy google services file

* Add resource-file way of copying google services files

* Bump requirements

* 🔧 Update cordovaDependencies

* 🔖 Bumping plugin version to 2.0.0-rc3

* 2.0.0-rc3

* Updating CHANGELOG

* Fixes 'framework not found GoogleToolboxForMac' linker error in 2.0.0-rc3 (#1715)

* Remove unused files (#1732)

* Remove GTM framework. (#1739)
@jabit
Copy link

jabit commented Jun 13, 2017

HI, here same problem, I can not get running "cordova-plugin-googleplus 5.1.1" with "phonegap-plugin-push 2.0.0-rc4" together.

I am on Ubuntu 16.04 using cordova 7.0.1 and Android Studio 2.3.3.
cordova plugin ls:
cordova-plugin-googleplus 5.1.1 "Google SignIn" (I have tried v. 5.1.0 as well with same result)
cordova-plugin-whitelist 1.3.2 "Whitelist"
phonegap-plugin-push 2.0.0-rc4 "PushPlugin" (same with 1.10.4)
cordova -v: 7.0.1

cordova requirements android:
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-26,android-25
Gradle: installed /opt/gradle/gradle-3.5/bin/gradle

cordova run android:
ANDROID_HOME=/home/javier/Android/Sdk
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
Subproject Path: CordovaLib
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_2yk4wyvk2jiu3c2ezjbfi0909.run(/home/javier/cordova/sportybetty/platforms/android/build.gradle:139)

FAILURE: Build failed with an exception.

  • Where:
    Script '/home/javier/cordova/sportybetty/platforms/android/phonegap-plugin-push/sportybetty-push.gradle' line: 12

  • What went wrong:
    A problem occurred evaluating root project 'android'.

Failed to apply plugin [id 'com.google.gms.google-services']
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

How can I fix that? tnk

@macdonst
Copy link
Member

@jabit that problem is being tracked in #1718

@lock
Copy link

lock bot commented Jun 3, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

7 participants