android - "Could not find method packageName()"RC1 错误 - flavor 不编译

标签 android android-studio

在以前版本的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”属性。

Changes listed here

关于android - "Could not find method packageName()"RC1 错误 - flavor 不编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27122939/

相关文章:

android - Android同步失败-找不到com.google.android.gms:play-services-auth:15.1.0

android - 打开/关闭 Realm 实例的最佳实践

java - Android 中 JsonObjectRequest 错误 500

android - Android Studio 默认代码样式方案遵循哪种格式?

java - 在片段内创建选项卡布局

android-studio - 在我的 Assets 上获取 "No file or variants found for asset"发现错误

重启后的android通知

android - Quickblox 不适用于 API 11 - javax.net.ssl.SSLPeerUnverifiedException : No peer certificate

java - 从 java 类调用 kotlin 函数会产生错误

android - 无法解析资源@style.AppTheme.AppBarOverlay