Open remch1990 opened 6 years ago
Hey, @remch1990 I am also facing the same issue, have you found any workaround for this? Sharing a image from WhatsApp crashes the app, and the user returned again to the WhatsApp.
I solved this issue by modifying this piece of code
public static String getImagePath(Context context, Uri uri){
if ("content".equalsIgnoreCase(uri.getScheme())) {
if (isGoogleOldPhotosUri(uri)) {
// return http path, then download file.
return uri.getLastPathSegment();
} else if (isGoogleNewPhotosUri(uri) || isMMSFile(uri)) {
// copy from uri. context.getContentResolver().openInputStream(uri);
return copyFile(context, uri);
}
//add this below line
return copyFile(context,uri);
}
return getDataColumn(context, uri, null, null);
}
Exception in native call java.lang.IllegalArgumentException: column '_data' does not exist at android.database.AbstractCursor.getColumnIndexOrThrow(AbstractCursor.java:333) at android.database.CursorWrapper.getColumnIndexOrThrow(CursorWrapper.java:87) at com.alinz.parkerdan.shareextension.RealPathUtil.getDataColumn(RealPathUtil.java:103) at com.alinz.parkerdan.shareextension.RealPathUtil.getRealPathFromURI(RealPathUtil.java:70) at com.alinz.parkerdan.shareextension.ShareModule.processIntent(ShareModule.java:61) at com.alinz.parkerdan.shareextension.ShareModule.data(ShareModule.java:37) at java.lang.reflect.Method.invoke(Native Method) at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:363) at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:162) at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31) at android.os.Looper.loop(Looper.java:154) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:194) at java.lang.Thread.run(Thread.java:761)