onConnectionFailed: ConnectionResult.getErrorCode() = 4

前端 未结 3 686
迷失自我
迷失自我 2021-01-02 21:19

Here i am doing google + integartion.i am using the following code but i am facing the error which is : onConnectionFailed: ConnectionResult.getErrorCode() = 4.So please any

相关标签:
3条回答
  • 2021-01-02 21:43

    For me the problem was that I had not created the credentials for the app.

    Went to Google Developers Console > Credentials > Create New Client ID

    filled the corresponding package name and SHA1 for my app, reran the app and then it worked!

    0 讨论(0)
  • 2021-01-02 21:49

    I had the same problem. I solved in google api console >> consent screen, and adding a Product Name.

    I try this tutorial: http://www.androidhive.info/2014/02/android-login-with-google-plus-account-1/

    In the main activity you need change .addApi(Plus.API, null) by .addApi(Plus.API, Plus.PlusOptions.builder().build())

    0 讨论(0)
  • 2021-01-02 21:52

    In case you are using MapView, make sure you are following the guidelines i.e.

    "When using the API in fully interactive mode, users of this class must forward all the activity life cycle methods to the corresponding methods in the MapView class. Examples of the life cycle methods include onCreate(), onDestroy(), onResume(), and onPause(). When using the API in lite mode, forwarding lifecycle events is optional. For details, see the lite mode documentation."

    @Override
    public void onResume() {
        mapView.onResume();
        super.onResume();
    }
    
    @Override
    public void onDestroy() {
        super.onDestroy();
        mapView.onDestroy();
    }
    
    @Override
    public void onLowMemory() {
      super.onLowMemory();
      mapView.onLowMemory();
    }
    
    0 讨论(0)
提交回复
热议问题