I have an application with about 5+ product flavors and I wrote a method in 
an external script that will create the versionCode.

Something similar to this:

apply from: 'versions.gradle'

android {

    productFlavors {
       dev {
            applicationId PACKAGE_NAME + ".dev"
            versionCode getBuildVersionCode(dev.name)
            versionName getBuildVersionName(dev.name)
        }

       // additional flavors with the same method calls for the versionCode 
and versionName
    }

}

When I run gradle, even just clean, I get the following error:

> Could not find method getBuildVersionCode() for arguments [dev] on 
GroupableProductFlavorDsl_Decorated{name=dev, minSdkVersion=null, 
targetSdkVersion=null, renderscriptTargetApi=null, 
renderscriptSupportModeEnabled=null, renderscriptNdkModeEnabled=null, 
versionCode=null, versionName=null, applicationId=null, 
testApplicationId=null, testInstrumentationRunner=null, 
testHandleProfiling=null, testFunctionalTest=null, signingConfig=null, 
resConfig=null, mBuildConfigFields={}, mResValues={}, mProguardFiles=[], 
mConsumerProguardFiles=[], mManifestPlaceholders={}}.

This is using the following:

Gradle 2.1 (wrapper)
Android Gradle Plugin 0.14.1

If I move the method from the external script into my build script, then it 
works.

I am wondering if this is a bug or if there is a work around for accessing 
the method in the external script or if there is a better way to generate 
the versionCode or versionName.





-- 
You received this message because you are subscribed to the Google Groups 
"adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to