Parth Godhani
Parth Godhani

Reputation: 239

ionic not generating android-build

[WARN] Not performing Ionic build for project type: ionic1.

ionic cordova prepare android cordova prepare android Running command: "C:\Program Files\nodejs\node.exe" C:\Users\pini\Desktop\Drivercheckcall\hooks\after_prepare\010_add_platfo rm_class.js C:\Users\pini\Desktop\Drivercheckcall

add to body class: platform-android Running command: "C:\Program Files\nodejs\node.exe" C:\Users\pini\Desktop\Drivercheckcall\hooks\after_prepare\020_remove_sas s_from_platforms.js C:\Users\pini\Desktop\Drivercheckcall

cordova build android --release × Running command - failed! [ERROR] An error occurred while running cordova build android --release (exit code 1):

    Running command: "C:\Program Files\nodejs\node.exe"
    C:\Users\pini\Desktop\Drivercheckcall\hooks\after_prepare\010_add_platform_class.js
    C:\Users\pini\Desktop\Drivercheckcall
    add to body class: platform-android
    Running command: "C:\Program Files\nodejs\node.exe"
    C:\Users\pini\Desktop\Drivercheckcall\hooks\after_prepare\020_remove_sass_from_platforms.js
    C:\Users\pini\Desktop\Drivercheckcall
    ANDROID_HOME=C:\Users\pini\AppData\Local\Android\sdk
    JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144
    Subproject Path: CordovaLib
    Starting a Gradle Daemon (subsequent builds will be faster)
    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_yewq1sjt6kzw92w3qmfn4wt0.run(C:\Users\pini\Desktop\Drivercheckcall\platforms\android\build.gradle:1

39)

    FAILURE: Build failed with an exception.

    * Where:
    Script
    'C:\Users\pini\Desktop\Drivercheckcall\platforms\android\phonegap-plugin-push\DriverCheckCall-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: 23.062 secs
    Error: cmd: Command failed with exit code 1 Error output:
    FAILURE: Build failed with an exception.

    * Where:
    Script
    'C:\Users\pini\Desktop\Drivercheckcall\platforms\android\phonegap-plugin-push\DriverCheckCall-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.

Upvotes: 2

Views: 1441

Answers (1)

Jean Guzman
Jean Guzman

Reputation: 2202

I have seen this issue before with push plugin or maps plugin or google plugin, it's regarding cordova plugins and their dependencies, in your case this line it's helpful.

Failed to apply plugin [class 'com.google.gms.googleservices.GoogleServicesPlugin'] For input string: "+" :

So one fix will be: inside platforms/android open project.properties, you will have something like this

cordova.system.library.2=com.google.android.gms:play-services-maps:+
cordova.system.library.3=com.google.android.gms:play-services-location:+

Try to have the google play services to match in version, in my case after specifying the version I ended up with the file like this:

# 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.system.library.2=com.google.android.gms:play-services-maps:11.0.1
cordova.system.library.3=com.google.android.gms:play-services-location:11.0.1
cordova.system.library.4=com.google.android.gms:play-services-location:11.0.1
cordova.system.library.5=com.android.support:support-v13:25.1.0
cordova.system.library.6=me.leolin:ShortcutBadger:1.1.17@aar
cordova.system.library.7=com.google.firebase:firebase-messaging:11.0.1
cordova.gradle.include.1=phonegap-plugin-push/custodian-push.gradle
cordova.system.library.8=com.squareup.okhttp3:okhttp:3+

Upvotes: 1

Related Questions