Open jens-duttke opened 5 months ago
Fixed that, I think. Apparently webviews need some boilerplate to handle file uploads.
It works fine if I open a photo from the "Photos" folder. But if I try to open a photo from the "Downloads" folder the app crashes:
2024-02-04 09:47:16.995 24389-24423 System.err com.simongellis.leia.webxr W java.lang.RuntimeException: An error occurred while executing doInBackground()
2024-02-04 09:47:16.995 24389-24423 System.err com.simongellis.leia.webxr W at WV.p4.done(chromium-TrichromeWebViewGoogle6432.aab-stable-609923033:41)
2024-02-04 09:47:16.995 24389-24423 System.err com.simongellis.leia.webxr W at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:381)
2024-02-04 09:47:16.995 24389-24423 System.err com.simongellis.leia.webxr W at java.util.concurrent.FutureTask.setException(FutureTask.java:250)
2024-02-04 09:47:16.996 24389-24423 System.err com.simongellis.leia.webxr W at java.util.concurrent.FutureTask.run(FutureTask.java:269)
2024-02-04 09:47:16.996 24389-24423 System.err com.simongellis.leia.webxr W at WV.p4.run(chromium-TrichromeWebViewGoogle6432.aab-stable-609923033:26)
2024-02-04 09:47:16.996 24389-24423 System.err com.simongellis.leia.webxr W Caused by: java.lang.IllegalArgumentException: You must pass a valid uri and observer
2024-02-04 09:47:16.996 24389-24423 System.err com.simongellis.leia.webxr W at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:172)
2024-02-04 09:47:16.996 24389-24423 System.err com.simongellis.leia.webxr W at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142)
2024-02-04 09:47:16.996 24389-24423 System.err com.simongellis.leia.webxr W at android.content.ContentProviderProxy.query(ContentProviderNative.java:481)
2024-02-04 09:47:16.996 24389-24423 System.err com.simongellis.leia.webxr W at android.content.ContentResolver.query(ContentResolver.java:1221)
2024-02-04 09:47:16.996 24389-24423 System.err com.simongellis.leia.webxr W at android.content.ContentResolver.query(ContentResolver.java:1152)
2024-02-04 09:47:16.996 24389-24423 System.err com.simongellis.leia.webxr W at android.content.ContentResolver.query(ContentResolver.java:1108)
2024-02-04 09:47:16.996 24389-24423 System.err com.simongellis.leia.webxr W at org.chromium.base.ContentUriUtils.b(chromium-TrichromeWebViewGoogle6432.aab-stable-609923033:18)
2024-02-04 09:47:16.997 24389-24423 System.err com.simongellis.leia.webxr W at WV.q8.b(chromium-TrichromeWebViewGoogle6432.aab-stable-609923033:23)
2024-02-04 09:47:16.997 24389-24423 System.err com.simongellis.leia.webxr W at WV.o4.call(chromium-TrichromeWebViewGoogle6432.aab-stable-609923033:10)
2024-02-04 09:47:16.997 24389-24423 System.err com.simongellis.leia.webxr W at java.util.concurrent.FutureTask.run(FutureTask.java:264)
2024-02-04 09:47:17.024 24389-24423 chromium com.simongellis.leia.webxr A [FATAL:jni_android.cc(290)] Please include Java exception stack in crash report
2024-02-04 09:47:17.273 24389-24423 libc com.simongellis.leia.webxr A Fatal signal 5 (SIGTRAP), code 1 (TRAP_BRKPT), fault addr 0x75a14dc0a4 in tid 24423 (ThreadPoolForeg), pid 24389 (llis.leia.webxr)
Does that work for you in normal chrome? When I test, I see the same behavior in both chrome and this app.
I've tried it on my website (https://www.duttke.de/en/lif/) and both works - normal JPEG photos but also non-image files like the leia-webxr.apk
.
If I open the same page on your app, it crashs even if I open JPEG files.
I also tried that on the Mozilla file-input example page, and it behaves the same.
On the other hand, opening large videos (> 3 GB), nothing happens - neither a crash nor does it open the file.
It seems to be only the "Downloads" folder (and it's sub-folders), everything else is accessible, Videos, Documents, the SD Card, even files from Google Drive or Google Fotos can be selected.
First of all, this project is absolute amazing. That's what I'm waiting for since I own the Leia Lumepad 2. I'm web-developer and working on a LIF viewer (https://www.duttke.de/en/lif/) - I'm working on a new UI which is more Leia-ish and using LeiaWebXR I would be able to implement a lot of features which would require a 3D preview.
While trying to implement that, I found two issues. The first one:
File dialogs doesn't open. You can check that here: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file
Tapping on the "Choose file" button doesn't do anything