问题
How can I exclude all /res/raw/*.wav
files from shrinking?
buildTypes {
release {
shrinkResources true
minifyEnabled true
}
}
回答1:
/res/raw/keep.xml
:
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools"
tools:keep="*.wav"/>
回答2:
Had a similar issue with two wav files - bell.wav
and beep.wav
in the res/raw/
folder. membersounds's answer above pointed the right direction, but did not solve the issue - this is the /res/raw/keep.xml
that worked:
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools"
tools:keep="@raw/bell,@raw/beep"/>
来源:https://stackoverflow.com/questions/45435215/how-to-exclude-resources-from-android-shrinkresources