Andriod Studio Popular article--3. About Gradle Frequently asked questions plug

Source: Internet
Author: User
Tags maven central


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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.