Android build flavour dimensions:

android

#1

Hi,
during the process of changing our build to use WebPack, the android build started to complain:

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

Try to get around it, I added

flavorDimensions "nativescript-fpauth", "secsto"

to the app.gradle. But that then brings up the error:

         + adding aar plugin dependency: mobile-app/node_modules/nativescript-ui-sidedrawer/node_modules/nativescript-ui-core/platforms/android/TNSCore-release.aar
         + adding aar plugin dependency: mobile-app/node_modules/tns-core-modules-widgets/platforms/android/widgets-release.aar

mobile-app/platforms/android/app/build/generated/source/buildConfig/nativescript-fpauthSecsto/debug/de/debeka/fotoapp/BuildConfig.java:13: error: ';' expected

  public static final String FLAVOR_nativescript-fpauth = "nativescript-fpauth";
                                                ^

mobile-app/platforms/android/app/build/generated/source/buildConfig/nativescript-fpauthSecsto/debug/de/debeka/fotoapp/BuildConfig.java:13: error: <identifier> expected

  public static final String FLAVOR_nativescript-fpauth = "nativescript-fpauth";
                                                       ^
2 errors

Any hints how to proceed?


#2

What’s your version of NativeScript Runtime and CLI?


#3
# tns --version
  4.2.3

tns-runtime is 4.2.0


#4

Also may I ask which plugin you are using?


#5

of course :slight_smile: as you might have seen, its fingerprint auth for once, but here is the list from package.json:

    "nativescript-angular": "^6.0.0",
    "nativescript-appversion": "^1.4.1",
    "nativescript-background-http": "^3.2.7",
    "nativescript-barcodescanner": "2.7.8",
    "nativescript-checkbox": "3.0.3",
    "nativescript-fingerprint-auth": "^6.0.3",
    "nativescript-iqkeyboardmanager": "^1.2.0",
    "nativescript-loading-indicator": "^2.4.0",
    "nativescript-localize": "^3.0.2",
    "nativescript-material-icons": "^1.0.3",
    "nativescript-permissions": "^1.2.3",
    "nativescript-secure-storage": "2.3.0",
    "nativescript-theme-core": "~1.0.2",
    "nativescript-ui-sidedrawer": "^4.3.0",

thank you for looking into this :slight_smile:


#6

Okay, had to do a “platform remove” and let the build add the platform again. Now it got through.

Thanks a lot for looking into it, I would really appreciate if you find an actual explanation to this - delete and rebuild is somewhat unstatisfying as a solution :wink: