Open marvpaul opened 2 years ago
From a quick glance at the code it seems like you are ending up with uri
being null
here for some reason:
https://github.com/keiwando/nativefileso/blob/47d2c3f8ccfcd8ca04f46c7d6c7cfdc77b996c56/Plugin-Projects/Android/NativeFileSO/lib_nativefileso/src/main/java/com/keiwando/lib_nativefileso/NativeFileOpenURLBuffer.java#L125
Maybe there need to be explicit null
checks before adding elements to the uris
ArrayList
here:
https://github.com/keiwando/nativefileso/blob/47d2c3f8ccfcd8ca04f46c7d6c7cfdc77b996c56/Plugin-Projects/Android/NativeFileSO/lib_nativefileso/src/main/java/com/keiwando/lib_nativefileso/NativeFileOpenActivity.java#L107
and here
https://github.com/keiwando/nativefileso/blob/47d2c3f8ccfcd8ca04f46c7d6c7cfdc77b996c56/Plugin-Projects/Android/NativeFileSO/lib_nativefileso/src/main/java/com/keiwando/lib_nativefileso/NativeFileOpenActivity.java#L110
I won't have time to be able to properly look into this any time soon.
Thanks a lot for your thoughts about it. I'll try to do this. Anyways, a fix from your side would be really appreciated as it produces a lot of crashes for my customers.
I'm trying to find out why some of my customers on Android getting these errors, perhaps you can help?
In the Google Play Console it says: Type java.lang.RuntimeException
java.lang.RuntimeException: at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3634) at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3879) at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:85) at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2203) at android.os.Handler.dispatchMessage (Handler.java:106) at android.os.Looper.loop (Looper.java:268) at android.app.ActivityThread.main (ActivityThread.java:8017) at java.lang.reflect.Method.invoke (Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:627) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:997) Caused by: java.lang.NullPointerException: at java.util.Objects.requireNonNull (Objects.java:245) at android.content.ContentResolver.query (ContentResolver.java:1172) at android.content.ContentResolver.query (ContentResolver.java:1130) at com.keiwando.lib_nativefileso.NativeFileOpenURLBuffer.getFilenameFromUri (NativeFileOpenURLBuffer.java:119) at com.keiwando.lib_nativefileso.NativeFileOpenURLBuffer.saveFilesInCacheDir (NativeFileOpenURLBuffer.java:171) at com.keiwando.lib_nativefileso.NativeFileOpenActivity.onCreate (NativeFileOpenActivity.java:73) at android.app.Activity.performCreate (Activity.java:8077) at android.app.Activity.performCreate (Activity.java:8061) at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1315) at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3607)
My code is:
And for import / export files I use:
And: