Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export destination is always "SD Card" #357

Closed
agalanin opened this issue Jul 25, 2015 · 32 comments
Closed

Export destination is always "SD Card" #357

agalanin opened this issue Jul 25, 2015 · 32 comments
Assignees

Comments

@agalanin
Copy link
Contributor

  1. Open the application
  2. Create some transactions
  3. Select Menu -> "Export transactions..."
  4. Select "Share file..." as export destination and press "Export"
  5. Check export destination

Expected result:

  1. Share file menu is displayed

Actual results:

  1. "Exported to : SD card" message displayed
  2. New file is created under /mnt/sdcard/org.gnucash.android/exports
@codinguser codinguser self-assigned this Jul 29, 2015
@nodje
Copy link

nodje commented Aug 18, 2015

same issue here

@codinguser
Copy link
Owner

I'm not able to replicate this so far.
What Android version are you running?

@agalanin
Copy link
Contributor Author

On Tue, 18 Aug 2015 00:47:31 -0700
Ngewi Fet notifications@github.com wrote:

I'm not able to replicate this so far.
What Android version are you running?

Android 2.3.6

Alexander Galanin

@nodje
Copy link

nodje commented Aug 19, 2015

Android 5.0.2
The problem did not occur prior to the two last updates (before 1.5.0?)
I will post a log trace when I can find the time.

@floriankisser
Copy link

Same here on CyanogenMod 11 (Android 4.4.4) with gnucash from f-droid. Last export that worked for me was on 07 July, first that didn't on 17 July (don't know the gnucash versions, sry).

@lennartS
Copy link

Same here on Android 4.2.2 (Fairphone OS). Pretty sure it's broken for me since version 1.6.1.

@agalanin
Copy link
Contributor Author

agalanin commented Oct 2, 2015

I am unable to export transactions via E-mail in version 2.0.0-beta1 too:

  1. select Menu->Export...
  2. export to: "send to..."
  3. select "export all transactions" and QIF format
  4. click "export"
    Expected results:
  5. export menu is displayed
    Actual result:
  6. "exported to: external service" message is displayed, new file is created under /sdcard/org.gnucash.android/exports.

@codinguser
Copy link
Owner

Thanks for the reports @nodje @floriankisser @lennartS @agalanin
Could you also let me know what your device locale is set to?

@lennartS
Copy link

lennartS commented Oct 3, 2015

Under „Language & input“ English is set as Language. If you mean a different locale setting, please let me know how to find it and I'll happily supply it.

@floriankisser
Copy link

de_at. Android 5.1.1 works neither.

@codinguser
Copy link
Owner

no, that's the one. Thanks

On Sun, Oct 4, 2015 at 12:52 AM, lennartS notifications@github.com wrote:

Under „Language & input“ English is set as Language. If you mean a
different locale setting, please let me know how to find it and I'll
happily supply it.


Reply to this email directly or view it on GitHub
#357 (comment)
.

@agalanin
Copy link
Contributor Author

agalanin commented Oct 4, 2015

Problem is reproducible with both Russian and English (US) locales.

@codinguser
Copy link
Owner

Please send me more details about your device, Android version, rooted or
not, etc.

I'm trying to find what the common denominator is for the devices where it
doesn't work.

On my device, I get the toast "Exported to external service" and then the
list of apps opens to choose from.

On Sunday, 4 October 2015, Alexander Galanin notifications@github.com
wrote:

Problem is reproducible with both Russian and English (US) locales.


Reply to this email directly or view it on GitHub
#357 (comment)
.

@agalanin
Copy link
Contributor Author

agalanin commented Oct 5, 2015

On Mon, 05 Oct 2015 00:30:39 -0700
Ngewi Fet notifications@github.com wrote:

Please send me more details about your device, Android version, rooted or
not, etc.

Android 2.3.6, Samsung GT-S6102, rooted

Alexander Galanin

@richardinside
Copy link

Same here. Gnucash version 1.6.3 installed from F-Droid. Version 1.6.1 does not work too.
Samsung Galaxy S2, Android 4.2.2, Cyanogen mod

Export to other sources (for example Owncloud) worked in older versions of Gnucash (maybe 1.5.*, but I'm not sure, and they are absent at F-Droid, so I cannot check which one works).

@codinguser
Copy link
Owner

ok, so far, the thing in common I see is Android devices with custom images (either rooted or Cyanogen).
@lennartS @floriankisser @nodje what about your devices?

@floriankisser
Copy link

Moto G 2013 xt1032, rooted, was on cyanogenmod 11 at first occurence and didn't update for a long time before that. Now I'm on cyanogenmod 12.1. Mail client that should open is k-9 mail btw.

@agalanin
Copy link
Contributor Author

agalanin commented Oct 8, 2015

Export to other sources (for example Owncloud) worked in older versions of Gnucash (maybe 1.5.*, but I'm not sure, and they are absent at F-Droid, so I cannot check which one worked).

Try to add F-Droid archive repository ( https://f-droid.org/archive ).

Alexander Galanin

@richardinside
Copy link

"Send file" works in old Gnucash version 1.5.5 from F-Droid archive repository. So something have been broken since that version.

One difference I have noticed between these two versions, is that default export option in version 1.5.5 is "Send file", but in version 1.6.3 is "SD Card". So it is possible that interface of changing this option in new versions just does not work.

PS: I also tried Gnucash version 1.6.3 on Android 5.1.1 Lollipop, Cyanogen mod, and this feature fails to work too.

@lennartS
Copy link

@codinguser I use FairPhone OS on a rooted device. GnuCash is installed via f-droid with K-9 mail as intended export target.

@alpha-and-omega
Copy link

It works in current Beta.

@agalanin
Copy link
Contributor Author

On Sat, 10 Oct 2015 06:49:22 -0700
alpha-and-omega notifications@github.com wrote:

It works in Beta. I think you guys just should wait for an update.

Doesn't work for me in version 2.0.0-beta3.

@codinguser
Copy link
Owner

This issue is not consistently reproducible.
Also I don't have a rooted or Cyanogen device to test, so it is difficult to pinpoint the problem.
But I'll keep looking

@lennartS
Copy link

@codinguser I can install a debug version next to the real thing if I choose a different certificate, right? I might be able to install a debug version and look for the cause of this bug, if you give me some pointers where to start.

@codinguser
Copy link
Owner

@lennartS if you checkout the code and run gradle iDD you will install a development version on your device. Your existing data will not be affected.
See the README for more detailed instructions

@rivaldi8
Copy link
Collaborator

I'm not sure, but I may having the same issue. In my case, however, the device isn't rooted and nothing gets writen to the SD card.

I've been debugging trying to figure out what is going on. I'll try to explain. Sorry, if it's a bit disperse.

What I'm seeing is that ExportAsyncTask.copyExportToSDCard() creates two files:

src = /data/data/org.gnucash.android.devel/files/20151019_190813_gnucash_export.qif
dst = /storage/emulated/0/org.gnucash.android.devel/exports/20151019_200858_gnucash_export.qif

dst path is supposed to point to the SD card, however it's actually writing to the internal storage. Nevertheless, I think it shouldn't be a problem, just curious.

Next copyFile(src, dst) is called, which in turn calls splitQIF(src, dst). The latter creates 20151019_200858_gnucash_export_EUR.qif in the export directory
(dst), but the list of files it returns is ignored.

Then, back at ExportAsyncTask, it calls shareFile(), but with output=dst as path instead of the one ended in "_EUR.qif" created by splitQIF(). As a consequence, shareFile() fails to open it:

E/ExportAsyncTask: Error split up files in shareFile. /storage/emulated/0/org.gnucash.android.devel/exports/20151019_211545_gnucash_export.qif: open failed: ENOENT (No such file or directory)

I haven't looked further into it, but I'd say the problem is the reuse of copyExportToSDCard(). Both copyExportToSDCard() and shareFile() call splitQIF(), but the latter is expecting the unsplited file.

My device is a bq Aquaris E4 with Android 5.0.

@rivaldi8
Copy link
Collaborator

I've been working on a fix, without luck yet though. Now it opens the share intent, but nothing is attached when I choose to send it by email.

I won't be able to work on it again until Thursday. In case someone wants to take a look meanwhile, here's what I've done so far:

https://github.com/rivaldi8/gnucash-android/tree/bugfix-357-export-always-sd-card

@codinguser
Copy link
Owner

@fefe982 could you look into this?

@rivaldi8
Copy link
Collaborator

It turns out it was already fixed. Somehow I ended up without any transaction, so there was nothing to attach :P

I've sent a pull request, but someone should test it first to ensure it's been really fixed and that nothing has been broken. It'd also be nice if someone could run the tests. As always, I can't make them run.

@codinguser
Copy link
Owner

Hey everyone,
please test the latest beta (v2.0.0-beta5) and let me know if this issue if fixed for you.
If you're not in the beta program, join here: https://play.google.com/apps/testing/org.gnucash.android

@agalanin
Copy link
Contributor Author

Hey everyone,
please test the latest beta and let me know if this issue if fixed for you.

  1. Export destination is "SD card" by default. I think that application
    should remember last selected combobox item.
  2. Export via external service is working now.

@rivaldi8
Copy link
Collaborator

Thanks for the testing @agalanin! I've opened a new issue (#408) for remembering the last export destination.

rivaldi8 added a commit to rivaldi8/gnucash-android that referenced this issue Nov 11, 2015
It's easier starting with this fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants