assets.srcDirs
,并尝试使用这种类型的结构。buildTypes {
release {
// ... the usual stuff here
}
releaseAlt {
// .. the usual stuff here too like signing config etc...
}
}
你应该拥有类似于文件层次结构的东西:
project/
- app/
- src/
- main/
- assets/
- logo.png // Generic assets go here
- java/
- res/
- ...
- flavor1/
- assets/
- logo.png // Specific assets for all the flavor1 Variants
- release/
- assets/
- logo.png // Specific assets for all the releaseAlt Variants.
- flavor1Release/
- assets/
- logo.png // very specific assets for the flavor1ReleaseAlt Variant
- SDK/
sourceSets {
amazon {
assets.srcDirs = ['/src/amazon/assets']
}
assets.srcDirs = ['src/amazon/assets']
设置为没有斜杠的形式,即assets.srcDirs = ['src/amazon/assets']
。 - sleepystar96
assets.srcDirs = ['app/src/amazon/assets']
移除。 - ישו אוהב אותך