新しい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\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
2つのBuildConfigファイルと2つのRクラスがあるようです。どうすれば問題を解決できますか?
編集:
コンパイラーが2つのR.javaファイルをコンパイルすることに気づきました。1つはプロジェクトフォルダーにあり、もう1つはフォルダー%USERPROFILE%.AndroidStudioPreviewにあります。このため、コンパイラー設定でこの「プレビュー」フォルダーを除外しようとしましたそして今それは働いています。この問題は、プロジェクトでGoogle Play開発者サービスクラスの使用を開始した後にのみ発生します。誰かがこの問題の背後にある理由を説明できれば幸いです。