wizmer / syncorg

An implementation of MobileOrg for the Android platform
GNU General Public License v3.0
174 stars 23 forks source link

App crashes whenever it tries to access the fs #45

Open kuba-orlik opened 7 years ago

kuba-orlik commented 7 years ago

I'm using the 2.0.5.3 version of SyncOrg on Android 4.3.1 (CM 10.2.1).

When I press "Parent Folder" in SSH setup or "ORG FILES DIRECTORY" in External/no sync setup, the app crashes.

pascal-huber commented 7 years ago

Hi,

Same problem here, same syncorg version, Android 6.0.1.

I can choose I folder for ssh with the following procedure.

  1. Create a folder with another app
  2. in syncorg go to "Parent folder"
  3. Create a new folder named /sdcard/nonexistingfolder
  4. Click "back"
  5. I now see my files and I can select the folder created in step 1
colonelpanic8 commented 7 years ago

check permissions?

pascal-huber commented 7 years ago

Just looked at it again,

I guess when going in "Parent folder" no folder is selected or syncorg is in a folder where it has no write access. Therefore "Select folder" will fail --> the app crashes (thats the bug, I guess). When creating a folder it works. So basically it works, but the app crashes as described above.

I was a bit irritated by the menu. When clicking "parent folder" I would expect to see a list of folders but it shows an empty screen with the option "select folder" which I then expected to show me the list of folders to choose from. Creating a new folder is the only way I found to give me my list of folders.

Sorry for the confusion & Thanks for the app! It seems very promising :)

kuba-orlik commented 7 years ago

I guess when going in "Parent folder" no folder is selected or syncorg is in a folder where it has no write access. Therefore "Select folder" will fail --> the app crashes (thats the bug, I guess).

Unfortunately, for me the app crashes as soon as I press "Parent Folder", I have no chance to even see the "select folder" option.

knezi commented 7 years ago

I think I've solved it. Can you confirm it? Either here: https://github.com/knezi/syncorg Or download apk at http://www.ms.mff.cuni.cz/~knizekj1/SyncOrg-debug.apk. Install via adb if you want to: $ adb push /path/to/SyncOrg-debug.apk /data/local/tmp/com.coste.syncorg $ adb shell pm install -r "/data/local/tmp/com.coste.syncorg" EDIT: this should solve @pascalhuber problem, not @kuba-orlik

knezi commented 7 years ago

@kuba-orlik I've looked in the file where it is happening (same for both SSH and NoSync). Unfortunately, I haven't found anything suspicious. Could you try to debug it? Just install AndroidStudio and run debug - in console you should see the error message. If you need help with this, ask.

pascal-huber commented 7 years ago

@knezi Thanks and sorry for not replying sooner (the semester has begun again)

I tried to install the apk on the phone and with adb, but failed. I don't know much about Android development, am I doing something wrong?

the phone error message is: Parse error - There was a problem parsing the package.

the adb-output:

➜  Downloads adb push SyncOrg-debug.apk /data/local/tmp/com.coste.syncorg
[100%] /data/local/tmp/com.coste.syncorg
➜  Downloads adb shell pm install -r "/data/local/tmp/com.coste.syncorg"
    pkg: /data/local/tmp/com.coste.syncorg
Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]
knezi commented 7 years ago

Oh, the problem is that Android won't allow you to install the app unless it's new or an update of an existing app. So I guess you've got SyncOrg installed. For this I'm afraid you have to uninstall it. Have you got some data there you could lost? If so, I can upload apk with a different name, so that the OS would allow you to have simultaneously both installed.

pascal-huber commented 7 years ago

@knezi Just tried it (the installation worked with adb after uninstalling syncorg). The bad: When opening SyncOrg for the first time, it shows the grey background for a couple of seconds and crashes. The good: after opening it the second time it crashes again but restarts automatically without crashing. When I click on "Parent folder" Android asks me if I want to allow SyncOrg to access files on my device. If I allow, I see two identical entries "/storage/emulated/0". If I try to open it, it tells my that the directory is empty (I guess this could be a permission problem). If I don't set up SyncOrg and just close and open it again I see the "main view" with the "Todos" and the "Agenda". If I then got to the wizard again and go on "Parent Folder" I see the content of /storage/emulated/0 and I can choose the appropriate folder.

btw: If I am the only one experiencing this issue don't bother fixing it ;) I can get it up running. If I am not the only one it might be worth while fixing it..