controller.sendCaptchaCodeToNumber(...) Error

90 views
Skip to first unread message

mkdotcom

unread,
Sep 30, 2015, 12:34:58 PM9/30/15
to Ringcaptcha

Hello

When using "controller.sendCaptchaCodeToNumber(...)" on Android, it always goes in the onError(Exception ex) method.
The exception is :

java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.SharedPreferences android.content.Context.getSharedPreferences(java.lang.String, int)' on a null object reference

Can you help me ?

Thanks a lot


Martin

unread,
Sep 30, 2015, 1:33:32 PM9/30/15
to mkdotcom, Ringcaptcha
looks like the SDK was not able to write to the Preferences file with the token. does it have the right privileges to do it?

--
Martin

--
You received this message because you are subscribed to the Google Groups "Ringcaptcha" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ringcaptcha...@googlegroups.com.
Visit this group at http://groups.google.com/group/ringcaptcha.
To view this discussion on the web visit https://groups.google.com/d/msgid/ringcaptcha/0fb29156-d609-4094-bada-16b7deeb36b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mkdotcom

unread,
Sep 30, 2015, 1:38:23 PM9/30/15
to Ringcaptcha, mar...@reynes.org
my app does use the "Preferences" with no issue, is there something special to do for Ringcaptcha ?

Martin

unread,
Sep 30, 2015, 1:41:42 PM9/30/15
to mkdotcom, Ringcaptcha
no - there's nothing special about it but we'll need to debug this to resolve it. I've tried duplicating it without success - are you open to trying with the SDK in its source fashion?

--
Martin

mkdotcom

unread,
Sep 30, 2015, 2:42:17 PM9/30/15
to Ringcaptcha, mar...@reynes.org
why not
on another phone i get a simple "java.lang.NullPointerException" in the onError()

mkdotcom

unread,
Sep 30, 2015, 2:57:53 PM9/30/15
to Ringcaptcha, mar...@reynes.org
problem is on this line (see attached screenshot)
Captureéé.PNG

li...@dahmakan.com

unread,
May 22, 2017, 6:50:51 AM5/22/17
to Ringcaptcha
Hi, I implement Ringcaptcha
```controller.sendCaptchaCodeToNumber(this, phoneNumber, RingcaptchaService.SMS, new RingcaptchaHandler() {
    @Override
public void onSuccess(RingcaptchaResponse ringcaptchaResponse) {

}

@Override
public void onError(Exception e) {

ALog.d(TAG, e.getMessage());
}
}, BuildConfig.RING_CAPCHA_API_KEY);

When i call `sendCaptchaCodeToNumber` , I received sms has pin, response status"SUCCESS" in log, but response jump in to onError with message"`'android.content.SharedPreferences android.content.Context.getSharedPreferences(java.lang.String, int)' on a null object reference", not onSuccess.
I use gradle to implement Ringcaptcha library. Please let me know what's wrong with this. thanks.

Yuta

unread,
Jun 13, 2017, 1:59:40 AM6/13/17
to Ringcaptcha
Hi li...@dahmakan.com

I am Yuta from RingCaptcha.
Sorry for the inconvenient about this.
We fixed the bug and published the updated SDK.

Please modify `build.gradle` file like below and sync Gradle again.

```
dependencies {
...
compile 'com.thrivecom:ringcaptcha:1.0.11@aar'
}
```
Thank you.
Reply all
Reply to author
Forward
0 new messages