离子 android 构建错误:“所有风味现在必须属于命名风味维度" [英] Ionic android build error : "All flavors must now belong to a named flavor dimension"

查看:26
本文介绍了离子 android 构建错误:“所有风味现在必须属于命名风味维度"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的电脑上开始了一个新项目,但我不能再为 android 构建

I've started a new project on my computer but I'm not able anymore to build for android

当我跑步时

ionic cordova platform run android

我收到此错误:

All flavors must now belong to a named flavor dimension. 

推荐答案

如果您在项目中安装了 cordova-plugin-crosswalk-webview 插件并尝试尝试,则会出现flavours"错误使用 Gradle v4 构建.

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.

但是,如果您想升级到 cordova-android@6.4.0(例如在 Android Studio 3 中打开您的 Cordova Android 平台项目以调试本机插件代码),您需要升级到 Gradle v4.因此,cordova-plugin-crosswalk-webview 目前与 cordova-android@6.4.0 不兼容.

However, if you want to upgrade to cordova-android@6.4.0 (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 cordova-android@6.4.0.

作为flavours"错误的手动解决方法,您可以在 platforms/android/build.gradle (见这里):

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"
    ...
} 

更新

如果您想使用 Gradle v4/cordova-android@6.4+cordova-plugin-crosswalk-webview 进行构建,请更新到 Gradle v4 然后安装 cordova-android 离开 master 分支,因为 这个 PR 来解决多个 APK 版本的风味"错误现已合并:

If you want to build with Gradle v4/cordova-android@6.4+ 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

这篇关于离子 android 构建错误:“所有风味现在必须属于命名风味维度"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆