Could not get unknown property 'ANDROID_SUPPORT_V4_VERSION' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler


#1

With some automatic updates my app will no longer compile for android, always erroring out with the error:

* What went wrong:
A problem occurred evaluating root project 'android'.
> Could not get unknown property 'ANDROID_SUPPORT_V4_VERSION' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

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

BUILD FAILED

I’ve tried upgrading/downgrading cordova and plugins and cordova-android, and adding the cordova-android-support-gradle-release plugin with the variable specified based on various google searches all to no avail. Anyone have any idea what’s going on and how to make it work?

Ionic Info:

cli packages: (/Users/mbeckett/.nvm/versions/node/v6.9.1/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.8
    Cordova Platforms  : android 6.3.0 ios 4.5.4
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.0.2
    ios-deploy        : 1.9.2
    Node              : v6.9.1
    npm               : 3.10.8
    OS                : macOS High Sierra
    Xcode             : Xcode 9.4 Build version 9F1027a

Environment Variables:

    ANDROID_HOME : /Users/mbeckett/Library/Android/sdk

Misc:

    backend : legacy

#2

I’m still not able to get past this, any insights from anyone?


#3
// upgrade cordova itself
$> npm -g install cordova

// Reinstall the maps plugin
$> cordova plugin rm cordova-plugin-googlemaps

$> cordova plugin add cordova-plugin-googlemaps --variable ...

#4

As I said in the other thread - cordova is up to date (and I have tried various versions), and I’m NOT using the google maps plugin

ionic cordova plugin list
> cordova plugin ls
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-http 1.2.0 "SSL Pinning"
cordova-plugin-inappbrowser 3.0.0 "InAppBrowser"
cordova-plugin-ionic-webview 1.2.1 "cordova-plugin-ionic-webview"
cordova-plugin-network-information 1.3.4 "Network Information"
cordova-plugin-speechrecognition 1.1.2 "Speech Recognition"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-tts 0.2.3 "TTS"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-sqlite-storage 2.3.2 "Cordova sqlite storage plugin"
cordova_app_version_plugin 0.2.6 "getAppVersion"
ionic-plugin-keyboard 2.2.1 "Keyboard"
phonegap-plugin-barcodescanner 6.0.8 "BarcodeScanner"

#5

I believe there is no plugin that use variable ANDROID_SUPPORT_V4_VERSION than cordova-plugin-googlemaps.

Anyway, you need to modify platform/platforms/build.gradle file by yourself.