nextcloud / android

📱 Nextcloud Android app
https://play.google.com/store/apps/details?id=com.nextcloud.client
GNU General Public License v2.0
4.27k stars 1.77k forks source link

Cannot open .docx or .xlsx files in Google office through Nexcloud App on Android #6377

Open Baptistou opened 4 years ago

Baptistou commented 4 years ago

Steps to reproduce

  1. Open Nextcloud App on Android
  2. Browse files
  3. Click on a Word or Excel file (.docx or .xlsx)
  4. Wait for the file being synced
  5. Authorize Google Docs/Sheets to access the file (first use only)

Expected behaviour

The .docx/.xlsx file should open in Google Docs/Sheets.

Actual behaviour

Google Docs/Sheets displays an error message: (translated) "Cannot open the document. The file is not available offline. Select option Available offline in the file menu to be able to access it even if you are not connected to internet." However, other document formats such as .odt for example are correctly opened in Google office. Moreover, it is possible to open the .docx/.xlsx document directly in Android file explorer > Android > media > com.nextcloud.client > nextcloud > username@domain.com > nextcloud_path_to_file.

Environment data

Android version: 10

Device model: Huawei P Smart 2019

Stock or customized system: EMUI 10.0.0

Nextcloud app version: 3.12.0

Nextcloud server version: 18.0.6

Reverse proxy: none

tobiasKaminsky commented 4 years ago

So if the same approach works for odt, then I think this might be some problem with google offlce?

Can you first download the file and then click on it?

Baptistou commented 4 years ago

So if the same approach works for odt, then I think this might be some problem with google offlce?

Can you first download the file and then click on it?

Same issue if I click on Menu > Download before clicking on the file, but I can open it without error outside Nextcloud App.

stale[bot] commented 4 years ago

This bug report did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

Baptistou commented 4 years ago

Which additional information do you need ? Is there a way to export logs from Nextcloud Android app ? I have reproduced exactly the same error on another Android smartphone.

tobiasKaminsky commented 4 years ago

Can you maybe give us some screenphotos?

Baptistou commented 4 years ago

Screenshot_20200805_143032_com google android apps docs editors sheets

stale[bot] commented 4 years ago

This bug report did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

tobiasKaminsky commented 4 years ago

Is there a way to export logs from Nextcloud Android app ?

You can install our dev version, there you can see "Logs" in settings, maybe this helps. But it seems more to be a problem of Google, if one file type is working and the other not.

stale[bot] commented 4 years ago

This bug report did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

mweinelt commented 3 years ago

I'm seeing this exact issue on a Pixel 4a with Android 11.

This is about .docx documents in Nextcloud. They are synchronized (green arrow) and opening them I run into a selection that lets me choose what to open it with. I choose to open with Google Docs, which in turn opens and tells me that the document cannot be opened, because it is not available offline, with the recommendation that I could save the file for offline access in the options menu. But this is probably a Google Docs message, so the recommendation is probably not very helpful

I can also choose Onlyoffice and get a toast "No read access from app", while there is a spinner that says "Opening...".

Both Nextcloud, Onlyoffice and Google Docs have the permission to access files and media.

I'd give the dev version of the app a shot and provide logging, but I'm not quite sure where I can get it.

mweinelt commented 3 years ago

Seems to be a permissions issue, below the adb logcat log when opening a docx file with Google docs. Using Nextcloud Android App 3.16.1.


06-12 20:04:38.507 16211 16211 E CAKEMIX_CRASHED: [main] uncaughtException java.io.FileNotFoundException: /storage/emulated/0/Android/media/com.nextcloud.client/nextcloud/gaby@files.he22.de/Gaby/Kochen/Kochbuch/40. Schlankr/Majon`s Sour Creme.docx: open failed: EACCES (Permission denied)
06-12 20:04:38.507 16211 16211 E CAKEMIX_CRASHED:   at libcore.io.IoBridge.open(IoBridge.java:492)
06-12 20:04:38.507 16211 16211 E CAKEMIX_CRASHED:   at java.io.FileInputStream.<init>(FileInputStream.java:160)
06-12 20:04:38.507 16211 16211 E CAKEMIX_CRASHED:   at java.io.FileInputStream.<init>(FileInputStream.java:115)
06-12 20:04:38.507 16211 16211 E CAKEMIX_CRASHED:   at android.content.ContentResolver.openInputStream(ContentResolver.java:1473)
06-12 20:04:38.507 16211 16211 E CAKEMIX_CRASHED:   at frc.b(PG:2)
06-12 20:04:38.507 16211 16211 E CAKEMIX_CRASHED:   at fmv.doInBackground(PG:14)
06-12 20:04:38.507 16211 16211 E CAKEMIX_CRASHED:   at android.os.AsyncTask$3.call(AsyncTask.java:394)
06-12 20:04:38.507 16211 16211 E CAKEMIX_CRASHED:   at java.util.concurrent.FutureTask.run(FutureTask.java:266)
06-12 20:04:38.507 16211 16211 E CAKEMIX_CRASHED:   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
06-12 20:04:38.507 16211 16211 E CAKEMIX_CRASHED:   at java.util.concurrent.FutureTask.run(FutureTask.java:266)
06-12 20:04:38.507 16211 16211 E CAKEMIX_CRASHED:   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
06-12 20:04:38.507 16211 16211 E CAKEMIX_CRASHED:   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
06-12 20:04:38.507 16211 16211 E CAKEMIX_CRASHED:   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
06-12 20:04:38.507 16211 16211 E CAKEMIX_CRASHED:   at java.lang.Thread.run(Thread.java:923)
06-12 20:04:38.507 16211 16211 E CAKEMIX_CRASHED: Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied)
06-12 20:04:38.507 16211 16211 E CAKEMIX_CRASHED:   at libcore.io.Linux.open(Native Method)
06-12 20:04:38.507 16211 16211 E CAKEMIX_CRASHED:   at libcore.io.ForwardingOs.open(ForwardingOs.java:166)
06-12 20:04:38.507 16211 16211 E CAKEMIX_CRASHED:   at libcore.io.BlockGuardOs.open(BlockGuardOs.java:254)
06-12 20:04:38.507 16211 16211 E CAKEMIX_CRASHED:   at libcore.io.ForwardingOs.open(ForwardingOs.java:166)
06-12 20:04:38.507 16211 16211 E CAKEMIX_CRASHED:   at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7546)
06-12 20:04:38.507 16211 16211 E CAKEMIX_CRASHED:   at libcore.io.IoBridge.open(IoBridge.java:478)
06-12 20:04:38.507 16211 16211 E CAKEMIX_CRASHED:   ... 13 more
06-12 20:04:38.507 16211 16211 E ModelLoadListenerImpl: [main] modelLoadFailed
06-12 20:04:38.507 16211 16211 E ModelLoadListenerImpl: java.io.FileNotFoundException: /storage/emulated/0/Android/media/com.nextcloud.client/nextcloud/gaby@files.he22.de/Gaby/Kochen/Kochbuch/40. Schlankr/Majon`s Sour Creme.docx: open failed: EACCES (Permission denied)
06-12 20:04:38.507 16211 16211 E ModelLoadListenerImpl:     at libcore.io.IoBridge.open(IoBridge.java:492)
06-12 20:04:38.507 16211 16211 E ModelLoadListenerImpl:     at java.io.FileInputStream.<init>(FileInputStream.java:160)
06-12 20:04:38.507 16211 16211 E ModelLoadListenerImpl:     at java.io.FileInputStream.<init>(FileInputStream.java:115)
06-12 20:04:38.507 16211 16211 E ModelLoadListenerImpl:     at android.content.ContentResolver.openInputStream(ContentResolver.java:1473)
06-12 20:04:38.507 16211 16211 E ModelLoadListenerImpl:     at frc.b(PG:2)
06-12 20:04:38.507 16211 16211 E ModelLoadListenerImpl:     at fmv.doInBackground(PG:14)
06-12 20:04:38.507 16211 16211 E ModelLoadListenerImpl:     at android.os.AsyncTask$3.call(AsyncTask.java:394)
06-12 20:04:38.507 16211 16211 E ModelLoadListenerImpl:     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
06-12 20:04:38.507 16211 16211 E ModelLoadListenerImpl:     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
06-12 20:04:38.507 16211 16211 E ModelLoadListenerImpl:     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
06-12 20:04:38.507 16211 16211 E ModelLoadListenerImpl:     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
06-12 20:04:38.507 16211 16211 E ModelLoadListenerImpl:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
06-12 20:04:38.507 16211 16211 E ModelLoadListenerImpl:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
06-12 20:04:38.507 16211 16211 E ModelLoadListenerImpl:     at java.lang.Thread.run(Thread.java:923)
06-12 20:04:38.507 16211 16211 E ModelLoadListenerImpl: Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied)
06-12 20:04:38.507 16211 16211 E ModelLoadListenerImpl:     at libcore.io.Linux.open(Native Method)
06-12 20:04:38.507 16211 16211 E ModelLoadListenerImpl:     at libcore.io.ForwardingOs.open(ForwardingOs.java:166)
06-12 20:04:38.507 16211 16211 E ModelLoadListenerImpl:     at libcore.io.BlockGuardOs.open(BlockGuardOs.java:254)
06-12 20:04:38.507 16211 16211 E ModelLoadListenerImpl:     at libcore.io.ForwardingOs.open(ForwardingOs.java:166)
06-12 20:04:38.507 16211 16211 E ModelLoadListenerImpl:     at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7546)
06-12 20:04:38.507 16211 16211 E ModelLoadListenerImpl:     at libcore.io.IoBridge.open(IoBridge.java:478)
06-12 20:04:38.507 16211 16211 E ModelLoadListenerImpl:     ... 13 more
mweinelt commented 3 years ago

Can someone reopen this issue or should I file a new one?

mweinelt commented 3 years ago

Sorry, not sure how else to proceed. Pinging @tobiasKaminsky maybe?

aclermont123 commented 2 years ago

Late to the party but we had the same issue and what seemed to fix it for us was to change the path for the data folder in the nextcloud apps. By default it's on "/storage/emulated/0/Android/media/com.netxcloud.client" When we change it to "/data/user/0/com.nextcloud.client/files" in Nextcloud -> Settings -> General -> Data storage folder , we dont get the Offline error with google Sheet anymore

Gizmokid2005 commented 2 years ago

Late to the party but we had the same issue and what seemed to fix it for us was to change the path for the data folder in the nextcloud apps. By default it's on "/storage/emulated/0/Android/media/com.netxcloud.client" When we change it to "/data/user/0/com.nextcloud.client/files" in Nextcloud -> Settings -> General -> Data storage folder , we dont get the Offline error with google Sheet anymore

I can confirm this was a resolution for me as well. It seems there may be something weird with file handling in the /storage/emulated folder that isn't present in /data/user. Migrating the files 100% solved my problems as well.