Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Could not find method packageName()" Error in RC1 - Flavors do not compile

The project which was built in the previous versions of Android Studio does not want to compile in the latest RC1.

The project uses flavors and I keep getting message:

Could not find method packageName() for arguments [org.XXYYZZ.apps] on GroupableProductFlavor_Decorated{name=english, 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={}}.

It seems that it breaks on the first flavor name as it's unable to use its method packageName.

Gradle version is

dependencies {
        classpath 'com.android.tools.build:gradle:0.14.4'
    }
}
apply plugin: 'android'
...

What could be causing this error? Any ideas how to fix it?

like image 901
sandalone Avatar asked Dec 06 '22 23:12

sandalone


1 Answers

PackageName is deprecated, it isn't supported anymore by the new Gradle plugin used in RC1. Use "applicationId" instead of "packageName" attribute.

Changes listed here

like image 164
carstenbaumhoegger Avatar answered Dec 10 '22 13:12

carstenbaumhoegger