1

To differentiate between different app flavors, I want to make a reference to the applicationId in my build.gradle like this:

externalNativeBuild {
    cmake {
        cppFlags += '-DAPPLICATION_ID="' + applicationId + '"'
    }
}

But gradle tells me that it

Could not get unknown property 'applicationId' for object of type com.android.build.gradle.internal.dsl.ExternalNativeCmakeOptions.

How could I achieve this?

An Hoa
  • 1,207
  • 12
  • 38
  • 2
    https://stackoverflow.com/a/36041577/115145 – CommonsWare Nov 23 '18 at 23:31
  • @CommonsWare It works with the stringize macro trick. I find no way to put a string like -DAPP_ID="..." since the quotes are all eaten away even when I put -DAPP_ID=\"...\". – An Hoa Nov 26 '18 at 18:05

0 Answers0