I updated my android studio to 2.2.Now when I open and run previous project I got error UnsupportedMethodException.
Unsupported method: AndroidProject.getPluginG
Through each modification of this trouble shoot (see below)
YOU CAN EITHER sync by doing File->Sync Project with Gradle Files OR
File -> INVALIDATE CACHES/RESTART
My Android Studio version
This is the TOP-LEVEL build.gradle (NOT THE INDIVIDUAL FOR YOUR PROJECT ""...\YOUR-PROJECT\build.gradle""
This is my INDIVIDUAL project build.gradle "...\YOUR-PROJECT\app\build.gradle"
This is my "...\YOUR-PROJECT\gradle\wrapper\gradle-wrapper.properties" file
This is the error
As per the answer above "Brian Fleming"
Browse through you should see a relation with the TOP LEVEL gradle file and the gradle-wrapper file
NOTE
It seems to be in the "app\build.gradle", THE INDIVIDUAL gradle file
It says"Dependencies: com.android.support:appcompat-v7:25.2.0: Obsolete dependency configuration found: compile[Update compile to implementation]"
Go through each warning and click **"[Update compile... in blue]" this should update each of the "compile" to "implementation"
You can also edit the file itself on notepad, I opted for doing it in the GUI **
Sync Project with Gradle Files
Next thing you know you will get this error.... "Gradle - Error Could not find method implementation() for arguments..."
This is because in my case the project I was working with was old, and had the gradle 2.0.0 in the TOP LEVEL YOUR-PROJECT/build.gradle
And 2.10 for the "...\YOUR-PROJECT\gradle\wrapper\gradle-wrapper.properties"
Also the INDIVIDUAL "...\YOUR-PROJECT\app\build.gradle" had the deprecated "compile" instead of the currently used "implementation"
Therefore when I substituted for the current "implementation" the gradle version for both gradle TOP-LEVEL and gradle-wrapper.properties files needed to be updated as well.
I updated them to TOP-LEVEL to 3.1.4 AND gradle-wrapper.properties to 4.4
SEE HERE
YOU MAY ALSO GET THIS ERROR something in the lines of "could not find file in jcenter"
There is 3 different repositories your build or gradle will get stuff from those are jcenter(), google() and mavenCentral() for more info go here: https://docs.gradle.org/current/userguide/declaring_repositories.html
In my case if you check my TOP LEVEL grade file the project only had jcenter(), so I just added google() in the repositories
Here
I only added it in the "buildscript", NOT in the "allprojects", I really don't know if in your case is different. But it worked for me (I only take baby steps and if not progress with more changes)
THIS MAY NOT APPLY TO YOU but check below if get this error
This error was produced because I had new grade files BUT my buildToolVersion in the INDIVIDUAL gradle file YOUR-PROJECT/app/build.gradle was below the minimum supported for those new gradel files. And the error itself tells you to change it to "27.03" (do it)
YOU CAN EITHER sync by doing File->Sync Project with Gradle Files OR File -> INVALIDATE CACHES/RESTART (This is the one I have been using through out this troubleshooting)