简体   繁体   中英

How to solve flavor “normal” has no flavor dimension in Android studio 3.0?

While I was opening an google project called iosched, the gradle building was failed and kept warning me something about flavor. I tried to solve it follow some suggestions online but it turned out to warn me this. What should I do?? My Android studio version is 3.0 btw.

在此处输入图片说明

In the build.gradle of app module you must define flavorDimensions which is from Android studio 3.0. so do something like :

android { flavorDimensions "example" }

and inside ProductFlavors on same module use it as:

productFlavors { a { dimension "example" } b{dimension "example" }

here a and b are the types of product flavors. For more information refer to this link Configure Build Variants

I got this error (and several others) after importing a project from version control via Bitbucket hyperlink.

Once imported, close the project and re-import it using File > New > Import Project . After that everything built correctly. (My productFlavors were already defined properly)

Meta: Android Studio 3.5 Build #AI-191.8026.42.35.5791312, built on August 8, 2019 JRE: 1.8.0_202-release-1483-b49-5587405 x86_64 JVM: OpenJDK 64-Bit Server VM by JetBrains sro macOS 10.13.6 Gradle 3.4.0

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM