Vui lòng, bạn có biết cách loại trừ một số tệp khỏi thư mục nội dung dự án Android trước khi nhiều thư mục nội dung được hợp nhất hoặc trong quá trình hợp nhất không?Gradle: Loại trừ tệp khỏi thư mục nội dung Android
Ví dụ:
android {
sourceSets {
main {
assets.srcDirs = [fileTree(dir: 'assets1', exclude: 'myfile.txt'), 'assets2'] // does not work
assets.exclude 'assets1/myfile.txt' // does not work
assets.exclude '**/*.txt' // does not work
assets.exclude '*.txt' // does not work
}
}
packagingOptions {
exclude 'assets1/myfile.txt' // does not work
exclude '**/*.txt' // does not work
exclude '*.txt' // does not work either
}
aaptOptions {
ignoreAssetsPattern "myfile.txt" // does not work
}
}
FYI: 'assets.srcDirs = [fileTree (dir: 'assets1', loại trừ: 'myfile.txt'), 'asset2'] 'không hoạt động. – Blackhex
Bạn có tìm thấy giải pháp cho điều này không? Có cùng một vấn đề với một số tập tin tài sản từ một phụ thuộc jar – 3c71