尝试使用enableAutoManage时GoogleApiClient给人“错了第一个参数类型”()函数

问题描述 投票:0回答:1

随着新移民到androidx代替android.v4或者我有一个艰难的时间搞清楚如何让GoogleApiClient.Builder()工作等支持库。我现在有这个设置:

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

凡SomeActivity已经延伸AppCompatActivity。然而,由于最近迁移androidx库,我有错误的参数类型,因为我使用的.enableAutoManage() androidx代替AppCompatActivityimport androidx.appcompat.app.AppCompatActivity版本android.support.v4.app.FragmentActivity功能状态。是否有任何解决方法吗?

android google-places-api google-api-client androidx appcompatactivity
1个回答
0
投票

如果有人也有这个问题。什么固定对我来说是我更新的gradle版本和Android Studio版本,其在张贴在其中有一些其他好的建议意见链接所指的最新产品。还要检查是否因为androidx是相当新的,一些图书馆尚未迁移到它的一些依赖你有你的gradle产出/行家都更新。

© www.soinside.com 2019 - 2024. All rights reserved.