0

I get the error

com.twitter.sdk.android.core.TwitterApiException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
    at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:390)
    at retrofit.RestAdapter$RestHandler.access$100(RestAdapter.java:220)
    at retrofit.RestAdapter$RestHandler$2.obtainResponse(RestAdapter.java:278)
    at retrofit.CallbackRunnable.run(CallbackRunnable.java:42)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
    at retrofit.Platform$Android$2$1.run(Platform.java:142)
    at java.lang.Thread.run(Thread.java:818)

Authorization completed with an error
 com.twitter.sdk.android.core.TwitterAuthException: Failed to get request token
     at com.twitter.sdk.android.core.identity.OAuthController$1.failure(OAuthController.java:95)
     at com.twitter.sdk.android.core.internal.oauth.OAuth1aService$1.failure(OAuth1aService.java:215)
     at com.twitter.sdk.android.core.Callback.failure(Callback.java:45)
     at retrofit.CallbackRunnable$2.run(CallbackRunnable.java:53)
     at android.os.Handler.handleCallback(Handler.java:739)
     at android.os.Handler.dispatchMessage(Handler.java:95)
     at android.os.Looper.loop(Looper.java:145)
     at android.app.ActivityThread.main(ActivityThread.java:5837)
     at java.lang.reflect.Method.invoke(Native Method)
     at java.lang.reflect.Method.invoke(Method.java:372)
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)

And Android Studio > Preferences > Server Certificates > does not have any Accepted Certificates.

How do I add the certificate?

Katedral Pillon
  • 14,534
  • 25
  • 99
  • 199
  • Can you share the code that triggers twitter and causes error? – Burak Kurkcu Oct 11 '15 at 22:22
  • This looks like a problem with the certificates on your device, rather than in Android Studio. What device are you running the App on? – adelphus Oct 11 '15 at 22:23
  • I do not have much twitter code at all, only a login button and so the likely culprit is `Twitter.getInstance().core.getSessionManager().getActiveSession()`. As for the issue being with my device, it's not. It's with android studio. The code used to work, but after updating android studio it stops working. Android studio used to have a certificate, I forgot the name, maybe `untaken` on something like that. now it's gone. – Katedral Pillon Oct 11 '15 at 22:28
  • Actually I think the name was untangle. – Katedral Pillon Oct 11 '15 at 22:31
  • Did you set a valid callback URL to login request? – Burak Kurkcu Oct 11 '15 at 22:49
  • Yes. Everything used to work, so the setup is correct. It's the new android studio. So maybe I have to completely uninstall android studio and reinstall it: drastic, I know. But I am completely blocked. – Katedral Pillon Oct 11 '15 at 22:55

0 Answers0