您的位置:首页 > 移动开发 > Android开发

GitHub上找到一个ViewPager项目,导入AndroidStudio一直报错Cause: org/gradle/api/publication/maven/internal/DefaultMa

2015-10-28 09:45 405 查看
报错的内容:Error:(2, 0) Cause: org/gradle/api/publication/maven/internal/DefaultMavenFactory<a href="openFile:C:\Users\Mr.young\Desktop\Android-ConvenientBanner-master\convenientbanner\build.gradle">Open File</a>去网上搜了很多,大多是说引用库里的apply plugin: ‘android-maven‘ 有问题1.引用库中除了android{...}, dependence{...}, apply plugin 其他全删掉,包括applyplugin: ‘android-maven‘ 这句2.再把引用库和project里的build.gradle中compileSdkVersion、buildToolsVersion确认一致后,发现可以使用了最后引用库中的build.gradle变成这样
apply plugin: 'com.android.library'
apply plugin: 'com.jfrog.bintray'

version = "1.0.9"//aar的版本

android {
compileSdkVersion 21
buildToolsVersion "20.0.0"

defaultConfig {
minSdkVersion 14
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile ('com.android.support:appcompat-v7:21.0.3')
}
project中的build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript {repositories {jcenter()}dependencies {classpath 'com.android.tools.build:gradle:1.3.0'classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'classpath 'com.github.dcendents:android-maven-plugin:1.2'// NOTE: Do not place your application dependencies here; they belong// in the individual module build.gradle files}}allprojects {repositories {jcenter()}}
参考资料:
http://www.bubuko.com/infodetail-1039660.html
还有一篇告诉我把引用库除了android{...},  dependence{...},  apply plugin 其他全删掉,地址找不到了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: