1

[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?

M. Usman Khan
  • 3,689
  • 1
  • 59
  • 69
  • "my library app that I am using in my app" - What does this mean? AAR, project directory, Intellj module? Also have you unpacked your release APK and checked if the resource file is there? – Morrison Chang Sep 14 '21 at 08:15
  • Library project directly. I just tried, opened signed apk in win rar, the raw files are not in there. – M. Usman Khan Sep 14 '21 at 09:02

0 Answers0