wizmer / syncorg

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

Sync org crashes on folder selection #31

Open sokolgeo opened 7 years ago

sokolgeo commented 7 years ago

Hello. The latest version of the app (2.0.5.2) crashed on Replicate Android ROM (based on Android 4.2).

Crash always happens when you click "select directory". On another device with Android 4.4 ROM "select directory" does not lead to any problems, but with Replicant/Android 4.2 it is always app crash.

Hope it helps.

wizmer commented 7 years ago

Hi. It may have something to do with the app permission. Check if all permissions are enabled for the app.

r-darwish commented 7 years ago

Happens to me as well. Storage permissions are turned on for the application

sokolgeo commented 7 years ago

Just re-tested with latest 2.0.5.3 app version.

With cyanogenmod 11 still no problem with folder selection.

With Android 4.2.2 (Replicant build) - still app crashes when I either try choosing directory in setup wizard or just try clicking OK without selecting any folder.

On next app start after the crash - app opens main window (Todos and Agenda empty lists). But when I try creating/adding new org file by using bottom-left icon - name of newly added file appears in the list under Todos and Agenda for a second and then name of newly added file disappears from the Todos and Agenda list.

Under 4.2.2 I checked permissions as good as I could. Nothing special. App properties say the app has:

The apps permissions seem like usual.

Still the app crashes on folder selection and fails to add new file.

Anything special I can do to force enabling all permissions for this app?

FHulot commented 7 years ago

Have this problem as well using 2.0.5.3 on Lineage 7.1.1(Nougat) installed from F-Droid. Doesn't crash but directory is empty and get "Failed to create folder" when I try to create one. Can't proceed from there. The app does have permission to do this.

Could you please tell me what folder this is in? Can I go in with file manager and create a parent directory? Tried this in some likely candidates but the folders I create don't show up in the app.

Thanks for all your work. Looking forward to using syncorg!!

FHulot commented 7 years ago

So this might be a workaround...

Using a file manager, create a folder in your home directory on the internal SD. For example SyncOrg.

When setting up the parent folder, select "create folder" and create a subfolder to the one you just created using the file manager. Use the full path. Mine was

/storage/emulated/0/SyncOrg/foo

Use the back button to go back one directory level. "foo" will be listed, indicating that what you think is happening is really happening.

Click "select folder", making /storage/emulated/0/SyncOrg the parent folder.

Using this, I was able to connect to a git repo on a local computer via SSH and get all the org files.

So far I have been able to see changes I make on the computer appear on the phone, but not vice versa.

knezi commented 7 years ago

You don't have to use a file manager. All you need to do is to create a directory /storage/emulated/0/SyncOrg in this app and then select.

sokolgeo commented 7 years ago

Creation of

/storage/emulated/0/SyncOrg

made no difference. App still crashes of folder selection attempt. Strange?

knezi commented 7 years ago

@sokolgeo it was a reply to FHulot that you don't need a file manager. If I get it correctly, you see the list of folders, but when you click the button "SELECT FOLDER," it crashes, is that right? If so, can you post the corresponding part of logcat? Simply connect your mobile do ADB, run adb logcat and then let the SyncOrg crash. The first line should contain something like: START u0 {cmp=com.coste.syncorg/.gui.wizard.wizards.NoSyncWizard}

drwebb commented 7 years ago

I get the same error. Just for the record, I do not see a list of folders. I created a SyncOrg folder in my home directory. Haven't set up an SDK on this computer so can't get a logcat at the moment. Looking forward to trying out the app!

adeleglise commented 7 years ago

Hi, I'm encoutering this issue as well.

Can't select a folder. I've allowed syncorg to access SD card.

Android 7 on Huawei Mate 8.

shanemd commented 7 years ago

Hi all,

I'm also experiencing this error. As soon as I press the "parent folder" button I get "Unfortunately, SyncOrg has stopped."

Here's a logcat dump of the crash. Hopefully this helps.

I/ActivityManager(  375): START u0 {cmp=com.coste.syncorg/.directory_chooser.FolderPickerActivity} from pid 15977
I/dalvikvm(15977): Could not find method com.coste.syncorg.directory_chooser.FolderPickerActivity.getExternalFilesDirs, referenced from method com.coste.syncorg.directory_chooser.FolderPickerActivity.populateRoots
W/dalvikvm(15977): VFY: unable to resolve virtual method 21407: Lcom/coste/syncorg/directory_chooser/FolderPickerActivity;.getExternalFilesDirs (Ljava/lang/String;)[Ljava/io/File;
D/dalvikvm(15977): VFY: replacing opcode 0x6e at 0x000d
D/dalvikvm(15977): DexOpt: couldn't find static field Landroid/os/Environment;.DIRECTORY_DOCUMENTS
W/dalvikvm(15977): VFY: unable to resolve static field 108 (DIRECTORY_DOCUMENTS) in Landroid/os/Environment;
D/dalvikvm(15977): VFY: replacing opcode 0x62 at 0x0053
I/dalvikvm(15977): Could not find method com.coste.syncorg.directory_chooser.FolderPickerActivity.checkSelfPermission, referenced from method com.coste.syncorg.directory_chooser.FolderPickerActivity.onCreate
W/dalvikvm(15977): VFY: unable to resolve virtual method 21400: Lcom/coste/syncorg/directory_chooser/FolderPickerActivity;.checkSelfPermission (Ljava/lang/String;)I
D/dalvikvm(15977): VFY: replacing opcode 0x6e at 0x004f
D/AndroidRuntime(15977): Shutting down VM
W/dalvikvm(15977): threadid=1: thread exiting with uncaught exception (group=0x41905700)
E/AndroidRuntime(15977): FATAL EXCEPTION: main
E/AndroidRuntime(15977): java.lang.NoSuchFieldError: android.os.Environment.DIRECTORY_DOCUMENTS
E/AndroidRuntime(15977):    at com.coste.syncorg.directory_chooser.FolderPickerActivity.populateRoots(FolderPickerActivity.java:134)
E/AndroidRuntime(15977):    at com.coste.syncorg.directory_chooser.FolderPickerActivity.populateAndDisplay(FolderPickerActivity.java:108)
E/AndroidRuntime(15977):    at com.coste.syncorg.directory_chooser.FolderPickerActivity.onCreate(FolderPickerActivity.java:103)
E/AndroidRuntime(15977):    at android.app.Activity.performCreate(Activity.java:5133)
E/AndroidRuntime(15977):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
E/AndroidRuntime(15977):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
E/AndroidRuntime(15977):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
E/AndroidRuntime(15977):    at android.app.ActivityThread.access$600(ActivityThread.java:141)
E/AndroidRuntime(15977):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
E/AndroidRuntime(15977):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(15977):    at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(15977):    at android.app.ActivityThread.main(ActivityThread.java:5103)
E/AndroidRuntime(15977):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(15977):    at java.lang.reflect.Method.invoke(Method.java:525)
E/AndroidRuntime(15977):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
E/AndroidRuntime(15977):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
E/AndroidRuntime(15977):    at dalvik.system.NativeStart.main(Native Method)
D/dalvikvm(15977): GC_CONCURRENT freed 195K, 3% free 10327K/10560K, paused 2ms+6ms, total 32ms
W/ActivityManager(  375):   Force finishing activity com.coste.syncorg/.directory_chooser.FolderPickerActivity
W/ActivityManager(  375):   Force finishing activity com.coste.syncorg/.gui.wizard.wizards.SSHWizard
W/ActivityManager(  375): Activity pause timeout for ActivityRecord{42b59de8 u0 com.coste.syncorg/.directory_chooser.FolderPickerActivity}
I/Process (15977): Sending signal. PID: 15977 SIG: 9
I/WindowState(  375): WIN DEATH: Window{429b30d8 u0 com.coste.syncorg/com.coste.syncorg.OrgNodeListActivity}
I/ActivityManager(  375): Process com.coste.syncorg (pid 15977) has died.
W/ActivityManager(  375): Service crashed 2 times, stopping: ServiceRecord{430e93d8 u0 com.coste.syncorg/.services.SyncService}
W/InputDispatcher(  375): channel '4329b530 com.coste.syncorg/com.coste.syncorg.gui.wizard.WizardActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
E/InputDispatcher(  375): channel '4329b530 com.coste.syncorg/com.coste.syncorg.gui.wizard.WizardActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
W/InputDispatcher(  375): Attempted to unregister already unregistered input channel '4329b530 com.coste.syncorg/com.coste.syncorg.gui.wizard.WizardActivity (server)'
I/WindowState(  375): WIN DEATH: Window{4329b530 u0 com.coste.syncorg/com.coste.syncorg.gui.wizard.WizardActivity}
I/WindowState(  375): WIN DEATH: Window{42afe760 u0 com.coste.syncorg/com.coste.syncorg.gui.wizard.WizardActivity}
I/WindowState(  375): WIN DEATH: Window{42a05fe0 u0 com.coste.syncorg/com.coste.syncorg.settings.SettingsActivity}
I/WindowState(  375): WIN DEATH: Window{430e0f30 u0 com.coste.syncorg/com.coste.syncorg.gui.wizard.wizards.SSHWizard}
I/ActivityManager(  375): Start proc com.coste.syncorg for activity com.coste.syncorg/.gui.wizard.WizardActivity: pid=16047 uid=10076 gids={50076, 3003, 1015, 1028}

I'm running Android 4.2 on a Galaxy Nexus.

EDIT: Also, I'm running SyncOrg 2.0.5.3 from F-Droid

rdiaz02 commented 6 years ago

For what is worth, with stock Android 7.1.2, and version 2.0.5.3 from the play store I get the exact same problem. (And apks for previous versions I cannot install: I am told they are corrupted).