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.