-
Notifications
You must be signed in to change notification settings - Fork 5
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
JSON library incompatible with Android #1
Comments
Thinking about it again, I think it should be possible to keep json.org in the project and write a workaround for Android. I'll try to come up with a solution ASAP and will create a pull request when I'm done. |
Pull request: #2 |
@Low012 Merged it , Is the server issue fixed too with this change ? loklak/loklak_server#544 |
The "HTTP code 504"-issue is a separate issue which I encountered both on an Android device running Loklak Wok for Android and on my Laptop running Loklak Wok for desktop. This issue prevented POSTing messages to the backend since it already crashed when the JSON. |
loklakj_lib uses the json.org JSON library. Android also uses json.org: https://developer.android.com/reference/org/json/package-summary.html
Unfortunately both versions are not compatible. The version used in loklakj_lib knows JSONObject.put(String, Collection) which is used in org.loklak.objects.MessageEntry for example. The version contained in Android does not know this method.
This seems to be the reason for the Android-Wok not being able to push data at the moment:
failed synchronous push to backend, attempt 4 java.lang.NoSuchMethodError: org.json.JSONObject.put at org.loklak.objects.MessageEntry.toJSON(Unknown Source) at org.loklak.objects.Timeline.toJSON(Unknown Source) at org.loklak.client.PushClient.push(Unknown Source) at org.loklak.android.wok.Harvester$PushThread.doInBackground(Harvester.java:263) at org.loklak.android.wok.Harvester$PushThread.doInBackground(Harvester.java:244) at android.os.AsyncTask$2.call(AsyncTask.java:288) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:841)
Unfortunately I think the only solution is to replace json.org.
The text was updated successfully, but these errors were encountered: