在以前版本的Android Studio中构建的项目不想在最新的RC1中编译。
该项目使用了 flavor,我不断收到消息:
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={}}.
它似乎打破了第一个 flavor 名称,因为它无法使用其方法 packageName
。
Gradle 版本是
dependencies {
classpath 'com.android.tools.build:gradle:0.14.4'
}
}
apply plugin: 'android'
...
是什么导致了这个错误?有什么解决办法吗?
最佳答案
PackageName 已弃用,RC1 中使用的新 Gradle 插件不再支持它。 使用“applicationId”而不是“packageName”属性。
关于android - "Could not find method packageName()"RC1 错误 - flavor 不编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27122939/