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 其他全删掉,地址找不到了
相关文章推荐
- Android RelativeLayout常用属性介绍
- 《Android开发开放平台》
- Android开发——对sdcard扩展卡文件操作
- android项目导包问题的解决方案
- android基础之页面间跳转传值,用Bundle+Intent
- Android的TextView/EditText使用CharacterStyle&SpannableString来处理图片显示、字体样式、超链接等
- Android的TextView使用Html来处理图片显示、字体样式、超链接等
- Android学习笔记:实现下拉刷新的ListView
- Android判断当前的android设备是否处于联网状态
- Service生命周期自我总结
- android正则表达式
- Android手机归属地查询工具
- Android 在MediaRecorder中碰到的几个常见的问题
- Android客户端每周自动化回归报告
- android常用名词收集
- 【Android自动化测试之Robotium】04. 命令行运行Android Robotium自动化用例或单元测试用例
- Android实现手机拍照功能
- Android 颜色对应的xml配置值,颜色表
- 【Android测试工具】01. Android TraceView工具使用详解
- 【Android自动化测试之Robotium】03. 当只有一个APK的时候使用robotium进行自动化测试