我在我的项目中添加achartengine-1.1.0.jar时遇到了麻烦。 当我添加 在build.gradle中,Gradle显示以下消息: Gradle: A problem occurred evaluating project ':NativeCharts'. Cannot ...
提示:本站收集StackOverFlow近2千万问答,支持中英文搜索,鼠标放在语句上弹窗显示对应的参考中文或英文, 本站还提供 中文繁体 英文版本 中英对照 版本,有任何建议请联系yoyou2525@163.com。
我将图书馆张贴在Artifactory
https://imagizer.imageshack.us/v2/806x253q90/631/kkK1Yn.png
这是我的摇篮
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle',
version: '3.0.1')
}
}
repositories {
jcenter()
mavenCentral()
mavenLocal()
maven {
url 'http://myartifactory:8081/artifactory/gradle-local'
}
}
apply plugin: 'com.jfrog.artifactory'
apply plugin: 'com.android.library'
apply plugin: 'android-apt'
def AAVersion = '3.2'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
}
}
dependencies {
compile fileTree(include: ['*.jar', '*.so'], dir: 'libs')
compile 'com.android.support:recyclerview-v7:21.0.+'
compile 'com.android.support:appcompat-v7:21.0.+'
compile 'com.android.support:support-v4:21.0.+'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'com.github.chrisbanes.photoview:library:1.2.3'
compile 'it.sephiroth.android.exif:library:+'
compile 'com.joanzapata.android:android-iconify:1.0.8'
compile 'com.android.support:cardview-v7:21.0.+'
compile 'com.afollestad:material-dialogs:0.6.0'
compile 'com.github.lzyzsd:circleprogress:1.0.1@aar'
apt "org.androidannotations:androidannotations:$AAVersion"
compile "org.androidannotations:androidannotations-api:$AAVersion"
compile(group: 'com.mylibrary.android.common', name: 'android.common', version: '1.0.0', ext: 'aar')
}
apt {
arguments {
androidManifestFile variant.outputs[0].processResources.manifestFile
resourcePackageName 'com.mypackage.library'
}
}
我得到这个错误
https://imagizer.imageshack.us/v2/519x72q90/540/8ojerK.png
我发现Gradle使用url运行路线错误,使用“ /”而不是“。”。
尝试去找
... 8081 / artifactory的/回购/ COM / mypackage中/安卓/普通/ android.common / 1.0.0 / android.common-1.0.0.aar
但应该是
... 8081 / artifactory的/回购/ com.mypackage.android.common / android.common / 1.0.0 / android.common-1.0.0.aar
我做错了,是错误的
您的工件不是抱怨标准的Maven布局,在该布局中,groupId应该用/
而不是用分隔.
。
没什么大不了的,Gradle可以轻松地处理它,您只是不能将存储库声明为maven
,而是声明为ivy
。
实际上,使用artifactory
插件进行解析会更容易,它也支持Maven和Ivy布局。
另外,请记住将Artifactory中的存储库设置为正确的布局 (不是Maven2,可能是Ivy)。
坦率地说,我认为也许值得在Maven布局下重新部署工件,这将使您的生活更轻松。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.