Android build failing: Failed to generate v1 signature

Hi!

Having successfully gone through browser based testing and iOS deployment, I’m currently building in order to start testing locally on Android.

When running “ionic cordova build android”, the build fails in the end with the following message: "Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use ‘–warning-mode all’ to show the individual deprecation warnings.
See Command-Line Interface - Gradle User Manual
46 actionable tasks: 3 executed, 43 up-to-date
FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:app:packageDebug’.

Failed to generate v1 signature

  • 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
    BUILD FAILED in 9s
    (node:40831) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: /Users/mikkomr/ionic/dojangamobile/platforms/android/gradlew: Command failed with exit code 1 Error output:
    FAILURE: Build failed with an exception.
  • What went wrong:
    Execution failed for task ‘:app:packageDebug’.

Failed to generate v1 signature

  • 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
    BUILD FAILED in 9s"

Here are my environment details:
cli packages: (/usr/local/lib/node_modules) @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.11 Cordova Platforms : android 7.0.0 browser 5.0.3 ios 4.5.4 Ionic Framework : ionic-angular 3.9.2
System: Android SDK Tools : 26.1.1 ios-deploy : 1.9.2 ios-sim : 6.1.2 Node : v6.9.4 npm : 4.0.5 OS : macOS High Sierra Xcode : Xcode 9.4.1 Build version 9F2000
Environment Variables:
ANDROID_HOME : /Users//Library/Android/sdk
Misc: backend : pro

My codebase seems to be all right since I subscribed to Ionic Pro and was able to build the native Android package out all right. I guess it’s something to do with the v1 signature but since I’m in debug phase and have Android Studio installed I believe the debug keystore should be created automatically…?

Best regards,
Mikko

This is pretty out of date. You should upgrade.

You can read about how to figure out the current Cordova versions and how to update CLI, platforms and plugins here: How to update Cordova CLI, Platforms and Plugins · ionic.zone

Thanks @Sujan12 . I upgraded the components but the error was still there.

However, I accidentally bumped upon https://forum.ionicframework.com/t/unable-to-use-ionic-cordova-run-android-prod-release/114430/3. This made me create a separate build.json file for the debug/release keystore files and finally, building successfully with command “ionic cordova build android --buildConfig”. Thanks for your help!