mvysny / aedict

Original Aedict 2 source codes
http://www.aedict.eu
GNU General Public License v3.0
40 stars 7 forks source link

Export Notepad as CSV via Send to Apps not possible #945

Closed Sauhund closed 3 years ago

Sauhund commented 3 years ago

Huawei P30 EMUI 10.1.0 Android 10

When trying to export any Notepad as CSV via "Send to Apps" (e.g. to Google Drive), I'm getting the attached error message. 105635607-06472b00-5e64-11eb-882c-3230db94cb9f

mvysny commented 3 years ago

This looks like a NullPointerException from within Aedict's code. I need to have a stacktrace in order to track the origin of this, could you please obtain a stacktrace for me? Please head to https://aedict.eu/faq.html "Aedict 3 log" for instructions on how to do that.

Sauhund commented 3 years ago

Thanks for the feedback. Do you have an email address, where I can send the log?

mvysny commented 3 years ago

Sure: martin@vysny.me

mvysny commented 3 years ago

Thank you, I have received the log and the exception is as follows:

01-25 15:11:25.122 15660-15660/? E/Aedict:Exporter2: Failed to send exported CSV via Intent
                                                     java.lang.NullPointerException: Attempt to invoke virtual method 'long java.io.File.length()' on a null object reference
                                                         at sk.baka.aedict3.util.export.Exporter2$ExportToCSVAsyncTask.sendAsIntent(Exporter2.java:530)
                                                         at sk.baka.aedict3.util.export.Exporter2$ExportToCSVAsyncTask.onPostExecute(Exporter2.java:492)
                                                         at sk.baka.aedict3.util.export.Exporter2$ExportToCSVAsyncTask.onPostExecute(Exporter2.java:404)
mvysny commented 3 years ago

This is an after-effect of another exception, which indeed points to the good-old-SDCard problem (being not writable):

                                                      Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied)
                                                         at libcore.io.Linux.open(Native Method)
                                                         at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
                                                         at libcore.io.BlockGuardOs.open(BlockGuardOs.java:252)
                                                         at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
                                                         at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:8196)
                                                         at libcore.io.IoBridge.open(IoBridge.java:482)
                                                         at java.io.FileOutputStream.<init>(FileOutputStream.java:235) 
                                                         at java.io.FileOutputStream.<init>(FileOutputStream.java:186) 
                                                         at sk.baka.aedict3.util.export.Exporter2$ExportToCSVAsyncTask.export(Exporter2.java:452) 
                                                         at sk.baka.aedict3.util.export.Exporter2$ExportToCSVAsyncTask.doInBackground(Exporter2.java:470) 
                                                         at sk.baka.aedict3.util.export.Exporter2$ExportToCSVAsyncTask.doInBackground(Exporter2.java:404) 
mvysny commented 3 years ago

Fixed in Aedict 3.50.21. On Android 10+, the CSV will be exported to Aedict's private cache dir, then shared from there.