新しい Android Studio で Google Play Services をテストしようとしています。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 Services クラスの使用を開始した後にのみ発生します。誰かがこの問題の背後にある理由を説明できれば幸いです。