Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
173 views
in Technique[技术] by (71.8m points)

android - SafetyNetApiRecaptchaTokenResult.getTokenResult()' on a null object reference

Hi i'm trying to integrate Google ReCaptcha in Android application. i'm getting this error after calling the /siteVerify api. i'm trying to get tokenResult from SafetyNetApi.RecaptchaTokenResponse Can anyone help me how to fix this issue.

java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.String com.google.android.gms.safetynet.SafetyNetApi$RecaptchaTokenResult.getTokenResult()' on a null object reference

here is the code snippit causing the error :

val body = response.body()!!
AppUtil.log("body : ${body.tokenResult}")

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...