首页 > 解决方案 > com.google.android.gms:play-services-auth:16.0.1 不包含 GoogleSignInOptions 类

问题描述

当我尝试导入此com.google.android.gms:play-services-auth:16.0.1代码并实现此代码以使用 google rest API 进行身份验证时,

GoogleSignInOptions signInOptions =
                new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
                        .requestEmail()
                        .requestScopes(new Scope(DriveScopes.DRIVE_FILE))
                        .build();
        GoogleSignInClient client = GoogleSignIn.getClient(this, signInOptions);

        // The result of the sign-in Intent is handled in onActivityResult.
        startActivityForResult(client.getSignInIntent(), REQUEST_CODE_SIGN_IN);

它说GoogleSignInOptions cannot be resolved to a type不确定这里缺少什么,

谁能帮我解决这个问题?提前致谢!

标签: androidgoogle-apigoogle-drive-api

解决方案


推荐阅读