-
Notifications
You must be signed in to change notification settings - Fork 369
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
Can't create handler inside thread that has not called Looper.prepare() #18
Comments
Yeah I got it. Gingerbread really doesnt like syncthing D:
Here's a fixed build (hopefully). Could you try if it works, and post a new logcat if not? Edit: That build won't actually work, will post a new one. Edit 2: Updated the above link. |
Removed the playstore app and installed from apk. After the welcome message |
Yeah reporting only works when installing through play store. Can you make a logcat of the crash (see google), and post that? |
Hello! Sorry for creating a new issue #28 - I should have checked that first. I tried the apk posted above and I get the following crash, but this time it gets to the welcome message before crashing: I/ActivityManager( 1298): Starting: Intent { act=android.intent.action.MAIN flg=0x10000000 cmp=com.nutomic.syncthingandroid.debug/com.nutomic.syncthingandroid.WebGuiActivity } from pid 10775 I had to cherry pick these lines out - if there's some grep/filter to apply that would help, let me know. |
That's weird, it can't read environment variables properly ( Can you try what the output of |
That works fine. I think the issue is that $HOME isn't set on my platform. When I run |
$EXTERNAL_STORAGE is set to /mnt/sdcard - maybe it could set $HOME to that in the event it is not set already? |
I run It's really hard debugging something without any way to reproduce/play around with it. I think it would be helpful if someone with a Gingerbread device could set up a build (see the readme) and figure out what the problem is, exactly. Edit: Btw I was sure I fixed the HOME dir problem in 0.3.2 (by setting HOME to the above path instead of |
I will set up a build. |
Great, thank you :) |
I have it building now but I am getting the "Can't create handler inside thread that has not called Looper.prepare()" crash - how did you prevent that in the build you released above? |
…bGuiAvailableTask() in SyncthingService on the WebGUI thread.
By the way, the way you have set the HOME variable won't let it be available to the syncthing process. You have done it like this in the shell:
You need to do this instead:
Note the space instead of the carriage return. Then the shell will pass the environment variable to the subprocess. You could probably also use |
I'm surprised that doesn't work on Gingerbread, as it definitely works on ICS+ as well as my Kubuntu desktop. Btw I fixed the Looper issue by just calling |
I think it does not work on any unix. Create a file called
chmod it 755.
Then:
Only the second one yeilds the correct value of 4. I don't know enough about Android to know if calling Looper.prepare() or running on the UI thread the way my patch did is the cleaner solution. Feel free to merge and modify the patch if you think it needs it. |
On Kubuntu the HOME environment variable would be set correctly already. Probably the same for ICS. |
No i mean i run Oh and I didnt call And while you're at it, could you try if setting HOME to sdcard works, and change it to that if so? |
That is because the $TEST is being evaluated in the same process as it was declared and then passed to Why don't you commit your code where you have the Looper.prepare() inside the runnable? I will set HOME to sdcard and test. |
I wasn't entirely sure if the Looper.prepare() works. If it does, just put it in ;) |
It gives me a permission denied error when trying to chmod if I use Environment.getExternalStorageDirectory() ("/mnt/sdcard") however if I use Environment.getExternalStorageDirectory() + "/syncthing" that works ok. What do you think? Is that an acceptable compromise? With regards to Looper.prepare() - does that not mean it is still running on a different thread from the GUI? I am not sure how safe that is. |
The permission error is coming from the syncthing binary? If so, we'll just leave it as it is ( Yes, the idea is that anything that might take long (even though the polling is asynchronous) should be done in a background thread if possible. There weren't any problems with that on ICS+, so if it works on GB, great. Otherwise, we'll use the way you implemented it. |
E/AndroidRuntime( 3342): FATAL EXCEPTION: Thread-11 I still think that /mnt/sdcard/syncthing is better as a $HOME than HOME=/data/data/com.nutomic.syncthingandroid/ - let me know which you'd prefer and I'll submit the pull request again with the Looper fix too. |
You're right, |
…o set up the thread.
…n to the syncthing process.
Well, I just tried it again and this time I got a permission error trying to chmod |
I'm closing this, feel free to make a pr if you get it working. |
…yncthing#80) (syncthing#79) * Add push APK to device after build script * Fix typo in SyncthingService comment * Refactor SettingsActivity - updatePersistentNotification Call updatePersistentNotification after the settings screen was left and not when the user toggles the alwaysRunInBackgroundAsAService checkbox. * Automatically start app if push-to-device is enabled * Remove PREF_NOTIFICATION_TYPE * Only push APK to device if build succeeded * Fix notifications and foreground service start/stop * Use startForegroundService on Android 8+ * Fix startActivity called from non-Activity context (fixes syncthing#80) * Fix comment
I think home dir bug is gone but I am getting this one upon startup.
Handler.java:121
Got my stack traces?
The text was updated successfully, but these errors were encountered: