Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio 3.0 Flavor Dimension Issue

Upgraded to Studio Canary build. My previous project of Telegram Messenger is giving following error.

Error:All flavors must now belong to a named flavor dimension. The flavor 'armv7' is not assigned to a flavor dimension. Learn more at https://d.android.com/r/tools/flavorDimensions-missing-error-message.html

What should I do? I have already seen that link but couldn't understand what to do. I have 3 build variants now, release,debug and foss.

like image 493
Omkar Nath Singh Avatar asked Oct 06 '22 23:10

Omkar Nath Singh


2 Answers

If you don't really need the mechanism, just specify a random flavor dimension in your build.gradle:

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

For more information, check the migration guide

like image 566
tknell Avatar answered Oct 08 '22 12:10

tknell


After trying and reading carefully, I solved it myself. Solution is to add the following line in build.gradle.

flavorDimensions "versionCode"

android { 
       compileSdkVersion 24
       .....
       flavorDimensions "versionCode"
} 
like image 63
Omkar Nath Singh Avatar answered Oct 08 '22 12:10

Omkar Nath Singh