RMK*_*RMK 10 android android-studio android-gradle-plugin
更新到Android studio 2.0预览版2后,在编译具有后缀.beta的beta风格时出现以下错误:
app build.gradle:
productFlavors {
beta {
applicationId 'com.example.app.beta'
}
production {
applicationId 'com.example.app'
}
}
Run Code Online (Sandbox Code Playgroud)
错误:
Error:(38, 44) error: package com.example.app.databinding does not exist
Run Code Online (Sandbox Code Playgroud)
在编制生产风味时,一切都很好.最令人费解的是,只有在运行应用程序时才会出现此错误(不在gradle sync期间)
小智 0
就我而言,问题出现在我创建productFlavors并尝试设置时sourceSets。最后我发现问题是由于
设置res中文件夹路径设置不正确造成的sourceSets。
改变
sourceSets {
develop {
res.srcDirs = ['wrong/path/src/develop/res']
}
Run Code Online (Sandbox Code Playgroud)
到
sourceSets {
develop {
res.srcDirs = ['src/develop/res']
}
}
Run Code Online (Sandbox Code Playgroud)
解决了我的问题。
| 归档时间: |
|
| 查看次数: |
358 次 |
| 最近记录: |