带有Google Play服务的Android Studio
我正在尝试使用新的Android Studio测试Google Play服务。我有一个与google_play_services.jar相关的项目。但是当我尝试重建项目时,我收到以下错误:
Information:[TstGP3-TstGP3] Crunching PNG Files in source dir: C:\Users\ans\AndroidStudioProjects\TstGP3\TstGP3\src\main\resInformation:[TstGP3-TstGP3] To destination dir: C:\Users\ans\AndroidStudioProjects\TstGP3\build\classes\res-cache\TstGP3-TstGP3Information:Compilation completed with 2 errors and 0 warnings in 2 secInformation:2 errorsInformation: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.BuildConfigC:\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类。我该如何解决这个问题?
编辑:
我注意到编译器编译了两个R.java文件:一个位于我的项目文件夹中,另一个位于文件夹%USERPROFILE%.AndroidStudioPreview所以,我试图在编译器设置中排除这个“Preview”文件夹现在它正在发挥作用。只有在我的项目中开始使用Google Play服务类后,才会出现此问题。如果有人能解释这个问题背后的原因,我将不胜感激。
慕沐林林
相关分类