Closed morningstar84 closed 9 years ago
Which version are you using and which error are you getting on the logs?
I'm using the latest version of SDK (6.2.0.9) and I get a "RuntimeException" thats kills the app even if the code is surrounded by a try-catch block that catch "Exception"
Can you catch the RuntimeException to see what's wrong? In Android, when they are not caught, they also show up in the console.
"RuntimeException" is subclass of "Exception" but it fails to manage it. As you can see in the screenshot, the detail of exception is void while running in debug mode.
Ah, maybe if you were catching Throwable instead it would catch it?
Anyways, there's a newer version of the Android SDK that fixes an issue that maybe related to yours (issue #9). I have published it to Maven but I guess you are adding the .jar manually, I have also added it to the releases page:
https://github.com/liferay/liferay-mobile-sdk/releases/tag/android-6.2.0.14
You are using services that you generated yourself, right? You should also re-generate with the latest builder, because issue #9 also changes the way services are generated.
Yes, I made a custom service. I regenerated the services using the latest SDK: now the catch-block works as it should but catch (or throw) a void Exception (null). In the debugger I can't see nothing interesting.
Thanks for the help
I made some changes in my code with an explicit declaration of long type:
long companyId = 10157l;
JSONArray groupIdArray = new JSONArray();
groupIdArray.put(13601l);
JSONArray calendarIds = new JSONArray();
calendarIds.put(13904l);
JSONArray calendarResIdArray = new JSONArray();
calendarResIdArray.put(13630l);
JSONArray statuses = new JSONArray();
statuses.put(0l);
JSONArray last = calendarbookingService.search(companyId, groupIdArray, calendarIds, calendarResIdArray, -1l , null, startTime, endTime, true, statuses, -1, -1, null);
Now, I'm getting a detail exception:
"com.liferay.mobile.android.exception.ServerException: No JSON web service action with path /calendar-portlet/calendarbooking/search and method null for /"
I solved the issue. The function search doesn't support "null" as value for keyword.
JSONArray last = calendarbookingService.search(companyId, groupIdArray, calendarIds, calendarResIdArray, -1l , "", startTime, endTime, true, statuses, -1, -1, null);
And finally i get the result
I see, that error means the server can't infer which method you are trying to call.
I want to report a bug related to the use of CalendarbookingService on android platform. Specifically, the invocation of the "search" function causes a crash of the application that you can not manage even with a try-catch block. An example of invocation is the following:
CalendarbookingService calendarbookingService = new CalendarbookingService(session);
The same code runs without problems on the iOs platform.
Thanks in advance for the help .