我最近下载了Android Studio,我认为它比eclipse有更多的功能.
我创建了一个具有登录活动的新项目,但似乎活动出现错误:![在此处输入图像描述] [1]
**Error:(78, 31) error: cannot find symbol class BuilderError: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”所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)