[EDIT: I have found that if I have "minifyEnabled true" set for release build, then I see the following issue. If removed, issue is resolved. Is this a bug?]
Original post:
I have my library that I am using in my app, as Library project. In that Library I am using raw files that are in "myLibrary\src\main\res
" folder. I use resources?.openRawResource(R.raw.file)
function to access the file.
This is working fine when I am developing project and run the app on my device. But when I download my published app from playstore, openRawResource()
fails and returns nullpointerException.
I opened signed apk in win rar, the raw files are not in there.
Also, when I use the following config to build and install the app on my device using Android Studio, then it works fine.
signingConfigs {
config {
keyAlias 'abc'
keyPassword 'pass'
storeFile file
storePassword 'abcPass'
}
}
Can you tell me what possibly could be wrong?