首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >带有Google Play服务的Android Studio

带有Google Play服务的Android Studio
EN

Stack Overflow用户
提问于 2013-05-18 21:32:30
回答 11查看 192.5K关注 0票数 95

我正在尝试用新的Android Studio测试Google Play服务。我有一个依赖于google_play_services.jar的项目。但是当我尝试重新构建项目时,我得到了以下错误:

代码语言:javascript
复制
Information:[TstGP3-TstGP3] Crunching PNG Files in source dir: C:\Users\ans\AndroidStudioProjects\TstGP3\TstGP3\src\main\res
Information:[TstGP3-TstGP3] To destination dir: C:\Users\ans\AndroidStudioProjects\TstGP3\build\classes\res-cache\TstGP3-TstGP3
Information:Compilation completed with 2 errors and 0 warnings in 2 sec
Information:2 errors
Information:0 warnings
C:\Users\ans\.AndroidStudioPreview\system\compiler\tstgp3.3f17bd41\.generated\Android_BuildConfig_Generator\TstGP3-TstGP3.74fc5b25\production\com\example\tstgp3\BuildConfig.java
    Error:Error:line (4)error: duplicate class: com.example.tstgp3.BuildConfig
C:\Users\ans\.AndroidStudioPreview\system\compiler\tstgp3.3f17bd41\.generated\aapt\TstGP3-TstGP3.74fc5b25\production\com\example\tstgp3\R.java
    Error:Error:line (10)error: duplicate class: com.example.tstgp3.R

它似乎有两个BuildConfig文件和两个R类。我如何解决这个问题?

编辑:

我注意到编译器编译了两个预览文件:一个在我的项目文件夹中,另一个在文件夹%USERPROFILE%.AndroidStudioPreview中。所以,我尝试在编译器设置中排除这个“预览”文件夹,现在它可以工作了。这个问题只有在我开始在我的项目中使用Google Play服务类之后才会发生。如果有人能解释一下这个问题背后的原因,我将不胜感激。

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16624827

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档