Ionic android build error : "All flavors must now belong to a named flavor dimension"

The "flavours" error will occur if you have the cordova-plugin-crosswalk-webview plugin installed in your project and you try to build with Gradle v4.

However, if you want to upgrade to [email protected] (e.g. to open your Cordova Android platform project in Android Studio 3 to debug native plugin code), you'll need to upgrade to Gradle v4. Hence cordova-plugin-crosswalk-webview is currently incompatible with [email protected].

As a manual workaround for the "flavours" error, you can insert a default flavour in the platforms/android/build.gradle (see here):

android { 
    ...
    flavorDimensions "default"
    ...
} 

Update

If you want to build with Gradle v4/[email protected]+ and cordova-plugin-crosswalk-webview, update to Gradle v4 then install cordova-android off the master branch, since this PR to resolve the "flavours" error with multiple APK builds has now been merged:

cordova platform rm android 
  && cordova platform add https://github.com/apache/cordova-android