java – 找不到符号类“Builder”
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了java – 找不到符号类“Builder”,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1647字,纯文字阅读大概需要3分钟。
内容图文
![java – 找不到符号类“Builder”](/upload/InfoBanner/zyjiaocheng/736/b54384909b0b44e3951c47f77b1ffa9e.jpg)
我最近下载了Android Studio,我认为它比eclipse有更多的功能.
我创建了一个具有登录活动的新项目,但似乎活动出现错误:![在此处输入图像描述] [1]
**Error:(78, 31) error: cannot find symbol class Builder
Error:Execution failed for task ':app:compileDebugJava'.
> Compilation failed; see the compiler error output for details.**
import com.google.android.gms.plus.PlusClient;
// This is the helper object that connects to Google Play Services.
private PlusClient mPlusClient;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Initialize the PlusClient connection.
// Scopes indicate the information about the user your application will be able to access.
mPlusClient =
new PlusClient.Builder(this, this, this).setScopes(Scopes.PLUS_LOGIN,
Scopes.PLUS_ME).build();
}
解决方法:
它是Unable to build PlusClient和can not find symbol class Builder的副本
对于快速参考:
问题是PlayClient现在已弃用,但模板仍然使用旧方法.
因此,您可以:
>将gradle依赖项(build.gradle)中的播放服务版本从com.google.android.gms:play-services:6.5.87更改为com.google.android.gms:play-services:6.1.71.
要么
>使用此处描述的新方法:http://android-developers.blogspot.in/2014/02/new-client-api-model-in-google-play.html,即不创建PlusClient.Builder实例,而是创建一个GoogleApiClient.Builder实例,如下所示:
// Builds single client object that connects to Drive and Google+
import com.google.android.gms.common.api.GoogleApiClient;
mClient = new GoogleApiClient.Builder(this)
.addApi(Drive.API)
.addScope(Drive.SCOPE_FILE)
.addApi(Plus.API, plusOptions)
.addScope(Plus.SCOPE_PLUS_LOGIN)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
内容总结
以上是互联网集市为您收集整理的java – 找不到符号类“Builder”全部内容,希望文章能够帮你解决java – 找不到符号类“Builder”所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。