Get the "org.json.JSONException: No value for session_token" Error in Android

Hi All,

I just install Bitnami with DreamFactory and follow all the steps on this page https://github.com/dreamfactorysoftware/android-sdk for Android SDK and phone book sample.

But when I enter the Email and password and click on RegisterEmail in Android App, in Logcat I got this error:
10-24 15:08:21.144 2369-2397/com.dreamfactory.android_sdk V/registerActivity: response string is: {“success”:true,“confirmation_required”:true}
10-24 15:08:21.144 2369-2397/com.dreamfactory.android_sdk E/registerActivity: going to onError() for a JSONException: org.json.JSONException: No value for session_token
10-24 15:08:21.144 2369-2397/com.dreamfactory.android_sdk E/registerActivity::baserequest::onError: org.json.JSONException: No value for session_token
10-24 15:08:21.144 2369-2369/com.dreamfactory.android_sdk V/registerActivity: finished call

How I can fix this?

Thanks in advanced

Hi,

I am also an Android developer. I tried with Android SDK. If you use the code from master branch, it could not work with DF2.0 or DF 1.9x. “No value for session_token” is because the format of response is not same as the code expected. I am very disappointed with that SDK, it wasted me a lot of time checking the differences and filling the gap. Now, I am writing Android SDK by myself, it is quite easy than using the public one.

Since the API response is {"success":true,"confirmation_required":true} then the user is registered. The API is done at that point, so the issue looks to be within the example app.

Can you verify that Allow Open Registration is enabled on your user service, that no email service is set for Open Reg Email Service, and that no email template is set for Open Reg Email Template?

Hi,
Thanks, can you publish it for using?

Hi,

Thanks, but in my Bitnami instance in Services -> “Open Reg Email Service Id” I don’t have blank option, just have Local Email Service.

How I can set it to blank?

The first option in the picklist should be blank.

Yes I know but I haven’t it in my instance.

Our engineers informed me this was an issue that is now fixed. You should be able to resolve it by downloading the latest Bitnami image. Be sure to clear your browser’s cache to ensure it’s not serving up any outdated elements.

1 Like