Search code examples
androidfacebookauthorizationibm-cloudibm-mobile-services

Failed to authenticate against MCA: Throwable: Failed to save certificate from response


I'm doing bluemix tutorial Sample Android App Link (android app) and got this exception. What can be wrong? I did everything step by step, generated signiture for my android app, linked facebook app with my bluemix app, compiled all libraries needed in gradle. Application works (adds and edits items) but I cannot delete items and authorize through facebook - and it is my aim. An error stack is below:

 03-14 21:29:49.579 14165-14165/? D/dalvikvm: Late-enabling CheckJNI
03-14 21:29:49.659 14165-14165/com.ibm.hellotodoadvanced D/HyLog: I : /data/font/config/sfconfig.dat, No such file or directory (2)
03-14 21:29:49.659 14165-14165/com.ibm.hellotodoadvanced D/HyLog: I : /data/font/config/dfactpre.dat, No such file or directory (2)
03-14 21:29:49.659 14165-14165/com.ibm.hellotodoadvanced D/HyLog: I : /data/font/config/sfconfig.dat, No such file or directory (2)
03-14 21:29:50.079 14165-14165/com.ibm.hellotodoadvanced I/dalvikvm: Could not find method android.app.Notification$Builder.setLocalOnly, referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zza
03-14 21:29:50.079 14165-14165/com.ibm.hellotodoadvanced W/dalvikvm: VFY: unable to resolve virtual method 265: Landroid/app/Notification$Builder;.setLocalOnly (Z)Landroid/app/Notification$Builder;
03-14 21:29:50.079 14165-14165/com.ibm.hellotodoadvanced D/dalvikvm: VFY: replacing opcode 0x6e at 0x00c2
03-14 21:29:50.079 14165-14165/com.ibm.hellotodoadvanced I/dalvikvm: Could not find method android.content.pm.PackageManager.getPackageInstaller, referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zzh
03-14 21:29:50.079 14165-14165/com.ibm.hellotodoadvanced W/dalvikvm: VFY: unable to resolve virtual method 572: Landroid/content/pm/PackageManager;.getPackageInstaller ()Landroid/content/pm/PackageInstaller;
03-14 21:29:50.079 14165-14165/com.ibm.hellotodoadvanced D/dalvikvm: VFY: replacing opcode 0x6e at 0x000b
03-14 21:29:50.329 14165-14165/com.ibm.hellotodoadvanced I/Adreno-EGL: <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build:  ()
                                                                       OpenGL ES Shader Compiler Version: E031.24.00.08
                                                                       Build Date: 03/21/14 Fri
                                                                       Local Branch: AU200-20140313-all-patches-KK8x26-664328
                                                                       Remote Branch: 
                                                                       Local Patches: 
                                                                       Reconstruct Branch: 
03-14 21:29:50.369 14165-14165/com.ibm.hellotodoadvanced D/OpenGLRenderer: Enabling debug mode 0
03-14 21:29:50.459 14165-14165/com.ibm.hellotodoadvanced I/ActivityManager: Timeline: Activity_idle id: android.os.BinderProxy@42106d40 time:95089030
03-14 21:29:50.589 14165-14237/com.ibm.hellotodoadvanced W/dalvikvm: VFY: unable to find class referenced in signature (Ljava/nio/file/Path;)
03-14 21:29:50.589 14165-14237/com.ibm.hellotodoadvanced W/dalvikvm: VFY: unable to find class referenced in signature ([Ljava/nio/file/OpenOption;)
03-14 21:29:50.589 14165-14237/com.ibm.hellotodoadvanced I/dalvikvm: Could not find method java.nio.file.Files.newOutputStream, referenced from method okio.Okio.sink
03-14 21:29:50.589 14165-14237/com.ibm.hellotodoadvanced W/dalvikvm: VFY: unable to resolve static method 60675: Ljava/nio/file/Files;.newOutputStream (Ljava/nio/file/Path;[Ljava/nio/file/OpenOption;)Ljava/io/OutputStream;
03-14 21:29:50.589 14165-14237/com.ibm.hellotodoadvanced D/dalvikvm: VFY: replacing opcode 0x71 at 0x000a
03-14 21:29:50.589 14165-14237/com.ibm.hellotodoadvanced W/dalvikvm: VFY: unable to find class referenced in signature (Ljava/nio/file/Path;)
03-14 21:29:50.599 14165-14237/com.ibm.hellotodoadvanced W/dalvikvm: VFY: unable to find class referenced in signature ([Ljava/nio/file/OpenOption;)
03-14 21:29:50.599 14165-14237/com.ibm.hellotodoadvanced I/dalvikvm: Could not find method java.nio.file.Files.newInputStream, referenced from method okio.Okio.source
03-14 21:29:50.599 14165-14237/com.ibm.hellotodoadvanced W/dalvikvm: VFY: unable to resolve static method 60674: Ljava/nio/file/Files;.newInputStream (Ljava/nio/file/Path;[Ljava/nio/file/OpenOption;)Ljava/io/InputStream;
03-14 21:29:50.599 14165-14237/com.ibm.hellotodoadvanced D/dalvikvm: VFY: replacing opcode 0x71 at 0x000a
03-14 21:29:52.989 14165-14237/com.ibm.hellotodoadvanced W/System.err: java.lang.RuntimeException: Failed to save certificate from response
03-14 21:29:52.989 14165-14237/com.ibm.hellotodoadvanced W/System.err:     at com.ibm.mobilefirstplatform.clientsdk.android.security.internal.AuthorizationProcessManager.saveCertificateFromResponse(AuthorizationProcessManager.java:222)
03-14 21:29:52.989 14165-14237/com.ibm.hellotodoadvanced W/System.err:     at com.ibm.mobilefirstplatform.clientsdk.android.security.internal.AuthorizationProcessManager.access$100(AuthorizationProcessManager.java:51)
03-14 21:29:52.989 14165-14237/com.ibm.hellotodoadvanced W/System.err:     at com.ibm.mobilefirstplatform.clientsdk.android.security.internal.AuthorizationProcessManager$1.handleAuthorizationSuccessResponse(AuthorizationProcessManager.java:133)
03-14 21:29:52.989 14165-14237/com.ibm.hellotodoadvanced W/System.err:     at com.ibm.mobilefirstplatform.clientsdk.android.security.internal.AuthorizationProcessManager$InnerAuthorizationResponseListener.onSuccess(AuthorizationProcessManager.java:469)
03-14 21:29:52.989 14165-14237/com.ibm.hellotodoadvanced W/System.err:     at com.ibm.mobilefirstplatform.clientsdk.android.security.internal.AuthorizationRequestAgent.processResponse(AuthorizationRequestAgent.java:388)
03-14 21:29:52.989 14165-14237/com.ibm.hellotodoadvanced W/System.err:     at com.ibm.mobilefirstplatform.clientsdk.android.security.internal.AuthorizationRequestAgent.processResponseWrapper(AuthorizationRequestAgent.java:542)
03-14 21:29:52.989 14165-14237/com.ibm.hellotodoadvanced W/System.err:     at com.ibm.mobilefirstplatform.clientsdk.android.security.internal.AuthorizationRequestAgent.onSuccess(AuthorizationRequestAgent.java:513)
03-14 21:29:52.989 14165-14237/com.ibm.hellotodoadvanced W/System.err:     at com.ibm.mobilefirstplatform.clientsdk.android.core.api.internal.BaseRequest$1.onResponse(BaseRequest.java:419)
03-14 21:29:52.989 14165-14237/com.ibm.hellotodoadvanced W/System.err:     at com.squareup.okhttp.Call$AsyncCall.execute(Call.java:170)
03-14 21:29:52.989 14165-14237/com.ibm.hellotodoadvanced W/System.err:     at com.squareup.okhttp.internal.NamedRunnable.run(NamedRunnable.java:33)
03-14 21:29:52.989 14165-14237/com.ibm.hellotodoadvanced W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
03-14 21:29:52.989 14165-14237/com.ibm.hellotodoadvanced W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
03-14 21:29:52.989 14165-14237/com.ibm.hellotodoadvanced W/System.err:     at java.lang.Thread.run(Thread.java:841)
03-14 21:29:52.989 14165-14237/com.ibm.hellotodoadvanced W/System.err: Caused by: java.security.cert.CertificateNotYetValidException
03-14 21:29:52.999 14165-14237/com.ibm.hellotodoadvanced W/System.err:     at com.android.org.conscrypt.OpenSSLX509Certificate.checkValidity(OpenSSLX509Certificate.java:216)
03-14 21:29:52.999 14165-14237/com.ibm.hellotodoadvanced W/System.err:     at com.ibm.mobilefirstplatform.clientsdk.android.security.internal.certificate.CertificatesUtility.checkValidityWithPublicKey(CertificatesUtility.java:59)
03-14 21:29:52.999 14165-14237/com.ibm.hellotodoadvanced W/System.err:     at com.ibm.mobilefirstplatform.clientsdk.android.security.internal.AuthorizationProcessManager.saveCertificateFromResponse(AuthorizationProcessManager.java:214)
03-14 21:29:52.999 14165-14237/com.ibm.hellotodoadvanced W/System.err:  ... 12 more
03-14 21:29:52.999 14165-14237/com.ibm.hellotodoadvanced E/MainActivity: Failed to authenticate against MCA: Throwable: Failed to save certificate from response
03-14 21:29:52.999 14165-14237/com.ibm.hellotodoadvanced E/MainActivity: Failed to authenticate against MCA, unknown reason

Solution

  • A few things could be going wrong here:

    • Your test device may be displaying an incorrect date or time. Ensure the date and time are accurate.

    • You may be using an unsupported Android OS. This sample supports API level 14 and up, (Android 4.0 and up).

    • Based on the other warnings in the logs, your test device may not contain the most up to date libraries needed. Ensure your device is up to date and/or emulator is properly configured.

    • Lastly, the further you continue down the error stack the more accurate a solution I can provide. I have never seen this error before so I will need the entire error stack plus your appId and route if the above solutions do not resolve your problem.