CYRUS-STUDIO / ImagePicker

Android下的图片选择与裁剪开源库(android image picker and cropper library)
http://www.jianshu.com/p/35ce3b82773e
239 stars 68 forks source link

Support android N+ #3

Closed af-kabramov closed 7 years ago

af-kabramov commented 7 years ago

android.os.FileUriExposedException: file:///storage/emulated/0/Android/data/org.refocusapp.refocus.staging/cache/pickImageResult.jpeg exposed beyond app through ClipData.Item.getUri()

http://stackoverflow.com/questions/38200282/android-os-fileuriexposedexception-file-storage-emulated-0-test-txt-exposed

good way i did myself

image

CYRUS-STUDIO commented 7 years ago

@af-kabramov Thank you, but i have not android N device now. can you pull requests?

af-kabramov commented 7 years ago

emulator?) sorry I have no time just now ((

CYRUS-STUDIO commented 7 years ago

thx , I will try.

ghost commented 7 years ago

Any solutions so far?

CYRUS-STUDIO commented 7 years ago

fixed, update gradle dependencies as follows:

compile 'com.linchaolong.android:imagepicker:1.2'

thanks @af-kabramov 's solutions

ghost commented 7 years ago

Thank you! It seems there occur another problem with doplicate provider tags now. If programmers use their own implementations of FileProvider, it is not possible because of duplicate name tag android:name="android.support.v4.content.FileProvider". The library and the project which is using the library could have the same name tag, because both extending "android.support.v4.content.FileProvider". I think the library should use its own unique FileProvider with a class just extending android.support.v4.content.FileProvider. Would be more save for programmers. See this post:

https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin/pull/748/commits/d1b4d75588219bf70bae037fc73a02fd094482e5