I have an application which works fine on its own. I have tested everything in different api levels and it is working as a charm.
Now I have included this application as a library to a test application. Everything is working fine except for a feature. This feature gives the following error :
04-06 11:03:17.792 12545-12555/? E/DatabaseUtils: Writing exception to parcel
java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=32652, uid=10096 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
at android.content.ContentProvider.enforceReadPermissionInner(ContentProvider.java:605)
at android.content.ContentProvider$Transport.enforceReadPermission(ContentProvider.java:480)
at android.content.ContentProvider$Transport.query(ContentProvider.java:211)
at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:112)
at android.os.Binder.execTransact(Binder.java:453)
04-06 11:03:17.793 32652-32652/com.arlind.catapulttesting2:wallpaper_chooser D/AndroidRuntime: Shutting down VM
04-06 11:03:17.794 32652-32652/com.arlind.catapulttesting2:wallpaper_chooser E/AndroidRuntime: FATAL EXCEPTION: main
The following application which I am using as an external library has the necessary permissions on the AndroidManifest file. Both READ_EXTERNAL_STORAGE permission and the WRITE one.
When you add an external library, does the android manifest of the later one merges with that of the application which hosts it ? I even tried adding the same permissions on the AndroidManifest of the hosting application and it still says the same thing...
Not a duplicate, the application works fine when it is used on its own. It shows this error when it is used as an external library. It works fine on android api level 21 when the application is used as a library.
My targetSdkVersion was 23
.
It appears on targetSdkVersion 22 it works fine even for android api level 23.
Does anyone have any thoughts on this ?