記錄:
在導(dǎo)入開源項(xiàng)目時(shí)煤禽,我們經(jīng)常會(huì)遇到這個(gè)問題:
Error: Plugin with id 'com.github.dcendents.android-maven' not found.
在Project的build.gradle
添加 **classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' ** 即可
buildscript {
repositories
{
jcenter()
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' //這里
classpath 'com.android.tools.build:gradle:2.1.2'
}}
如果導(dǎo)入 ** classpath 'com.github.dcendents:android-maven-plugin:1.2' **
可能會(huì)遇到:
Error:Unable to load class ‘org.gradle.api.publication.maven.internal.DefaultMavenFactory’
解決:Gradle 版本的問題,在Gradle 版本 2.4以上岖赋,同時(shí)Android studio版本在1.3.0以上的時(shí)候檬果,就會(huì)出現(xiàn)這個(gè)問題。
改成1.3就行唐断。
錯(cuò)Q〖埂!脸甘!
1.2和1.3的區(qū)別
1.3的項(xiàng)目名是android-maven-gradle-plugin
1.2的項(xiàng)目名是android-maven-plugin
以為只改版本號(hào)就行恳啥,尼瑪。避免踩坑丹诀。