0

With the new migration to androidx instead of android.v4 or other support libraries I'm having a tough time figuring out how to get the GoogleApiClient.Builder() to work. I currently have this setup:

mGoogleApiClient = new GoogleApiClient.Builder(SomeActivity.this)
            .addApi(Places.GEO_DATA_API)
            .enableAutoManage(this, GOOGLE_API_CLIENT_ID, this)
            .addConnectionCallbacks(this)
            .build();

Where SomeActivity already extends AppCompatActivity. However, due to a recent migration to androidx libraries the .enableAutoManage() function states that I have the wrong argument type as I'm using the androidx version of AppCompatActivity import androidx.appcompat.app.AppCompatActivity instead of android.support.v4.app.FragmentActivity. Are there any workarounds to this?

Alvin X.
  • 161
  • 1
  • 7
  • isn't there a AndroidX version of `GoogleApiClient`? – Vladyslav Matviienko Feb 08 '19 at 08:43
  • Not sure, I haven't found anything about that. Is there a different gradle implementation for that? – Alvin X. Feb 08 '19 at 08:50
  • 1
    I'm not using AndroidX, but this is what I found so far: https://stackoverflow.com/questions/51179459/supportmapfragment-does-not-support-androidx-fragment – Vladyslav Matviienko Feb 08 '19 at 09:06
  • I'll check on my gradle version and see some of the other things suggested here tomorrow since it's 4am here. I am already on version 16.0.0 so I don't think it's that. Thank you so much for your help though. I'll see if any of these apply and update accordingly. – Alvin X. Feb 08 '19 at 09:19

1 Answers1

0

If anyone is also having this issue. What fixed it for me was updating my gradle version and android studio version to the latest which is referred in the link posted in the comments which has some other good suggestions. Also check whether some dependencies you have in your gradle/maven are updated as well since androidx is fairly new and some libraries have not migrated yet to it.

Alvin X.
  • 161
  • 1
  • 7