I use FileProvider to get photos from the device. The implementation works fine in debug builds (minifyEnabled false), but when I create the release assembly (minifyEnabled true), I get an error message:
java.lang.RuntimeException: Unable to get provider android.support.v4.content.FileProvider: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.content.FileProvider" on path: DexPathList[[zip file "/data/app/com.package.name-2/base.apk"], nativeLibraryDirectories=[/data/app/om.package.name-2/lib/arm, /vendor/lib, /system/lib]]
So, I think this has to do with installing proguard
I have
compile 'com.android.support:support-v13:23.1.1'
which is a superset of v4 in the gradle file and
minSdkVersion 21 targetSdkVersion 23
and
-keep class android.support.v4.app.** { *; } -keep class android.support.v4.content.** { *; } -keep interface android.support.v4.app.** { *; } -keep interface android.support.v4.content.** { *; } -keep class * extends android.content.ContentProvider
in the file proguard-rules.pro
I tested with Android 5 and 6, and the same thing happens. Any suggestion would be helpful, thanks in advance.
android proguard android-support-library
Draganescu valentin
source share