1, andriod Gradle plugin version number is too low.
Error location:
dependencies{ classpath ' com.android.tools.build:gradle:0.10.2 '}
Tip Info: You must use a newer version of the Android Gradle plugin. The minimum supported version is 0.12.0 and the recommended version is 0.12.+
This is generally the case for importing other people's projects today. or after you have updated Android studio. The reason is that Android Studio is built on Gradle and uses the relevant Android Gradle plugin when building Android projects. With the update of Android studio and SDK, the plugin that may cause the old version number is not available (for example, after the 19.0 version number of build tools, Zipalign is moved from the Tools folder to the corresponding version number folder in Build tools). So the new version of Android Studio will require a higher version of the plugin to compile.
Follow the prompts to change the plug-in version number to 0.12.0 above will be able, the recommended version number is the use of 0.12.+.
2, MAVEN related issues.
The item appears after importing: Error: (0) No such Property:sonatyperepo for class: Org.gradle.api.publication.maven.internal.ant.DefaultGroovyMavenDeployer.
This is usually the time to import some open source projects.
The original author of the project will publish the project to the MAVEN central warehouse. So the relevant MAVEN announcement task was added to the gradle. The publication task needs to configure username (Cannot find username is the same problem) or Sonatyperepo attributes such as values, the author does not upload these values, so that these properties are not found.
You are not the author of the project. Naturally, these tasks are not required, and the cleanest way to do this is to remove these tasks and the references to MAVEN, signing plugin declarations. Of course, you can also add the values of these properties that are not found in gradle.properties to compile.
For example, I joined in the gradle.properties:
#To fix compile error. The three variable names here are configured in detail depending on the variable name referenced in Uploadarchives. Sonatyperepo=nullsonatypeusername=nullsonatypepassword=null
Copyright notice: This article blog original articles, blogs, without consent, may not be reproduced.
Andriod Studio Popular article--3. About Gradle Frequently asked Questions plug