I need to exclude certain assets files (a few MP3's) from final the APK. That is, they are not included in the APK compiled. How I can do this using eclipse?
Thanks in advance.
I need to exclude certain assets files (a few MP3's) from final the APK. That is, they are not included in the APK compiled. How I can do this using eclipse?
Thanks in advance.
You need to remove these mp3's from your assets
folder. If you want to keep them with the project but not in the APK, just create separate folder (i.e. PROJECT
and move your files there). This folder will be omitted by building scripts but you still can have these files in one place and can have them i.e. versioned etc.
You should use Proguard for this.
It is designed specifically to package different resources when building an APK. It is already enabled in a standard Eclipse Android project, you will just need to uncomment a line in your project.properties file, and also make modifications to the Proguard rules.
Try with next:
...
packagingOptions {
exclude 'META-INF/LICENSE.txt'
}
}
android.applicationVariants.all { variant ->
//if (variant.name.contains('Release')) { // exclude source and sourcemap from release builds
def rmmp3 = task("delete${variant.name}.rmmp3", type: Delete) {
delete "${buildDir}/intermediates/assets/${variant.dirName}/*.mp3"
}
variant.mergeAssets.finalizedBy rmmp3
//}
}