So, I am getting the following error while running the project after upgrading build.gradle (Project) from
dependencies {
classpath \'com.android.too
Just restart
your AS, then Rebuild
your app!
Try installing via :app:installDebug
. If it works then it is related to Android Studio's caches. I removed .gradle/
folder inside my project and it works.
I had the same problem and realised that the two separate jar files I had in my app/libs folder had the same packages as sub dependencies, which caused the conflict.
I met the same problem,and i clean project ,some other problems causeed can not clean,so i manually delete dir 'build' ,so it can can clean Ok,then run it ok for me.
This question have many answers but, if you not solved your error yet, this could work:
Sometimes we import different versions from google products/APIs so, try to organize your gradle file to solve the:
Mixing versions
warning
After I upgraded to Android Studio 2.1, the next time I rebooted, I was asked to upgrade to JDK 1.8. After I upgraded to JDK 1.8, that's when my AS project had trouble compiling. I followed all of the suggestions in this page, but to no avail. Finally, I decided to check the version of JDK that my project was using, and to my surprise, it somehow was pointing to JDK 1.8!
Moral of the story: If compileSdkVersion<=23, double check that your project is using JDK1.7 as follows: