android - Not compile library file of Svg image Loader
问题描述
I compile this dependancy in my project:
compile 'com.github.ar-android:AndroidSvgLoader:1.0.1'
Is not sync properly and give the follownig errors:
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.github.ar-android:AndroidSvgLoader:1.0.1.
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.github.ar-android:AndroidSvgLoader:1.0.1. Unable to resolve dependency for app@debugAndroidTest/compileClasspath': Could not resolve com.github.ar-android:AndroidSvgLoader:1.0.1.
Unable to resolve dependency for app@debugAndroidTest/compileClasspath Could not resolve com.github.ar-android:AndroidSvgLoader:1.0.1
I also write dependency
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io'; }
// but still not working....
}
}
Gradle Files:
project file
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url 'https://jitpack.io' }
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
App Gradle File
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "edru.techxpose.co.recycleviewdemo"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
implementation 'com.github.ar-android:AndroidSvgLoader:1.0.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-
core:3.0.2'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.caverock:androidsvg:1.2.1'
implementation files('libs/svg-android-2.0.5.jar')
}
解决方案
试试这个代码:
项目文件:
buildscript {
repositories {
maven { url 'https://jitpack.io' }
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url 'https://jitpack.io' }
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
应用 Gradle 文件
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "edru.techxpose.co.recycleviewdemo"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
implementation 'com.github.ar-android:AndroidSvgLoader:1.0.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.caverock:androidsvg:1.2.1'
implementation files('libs/svg-android-2.0.5.jar')
}
推荐阅读
- batch-file - 在文本文件中的每一行的最后一个分隔符之后提取字符串
- python - 即使在将 Black 配置为格式化程序后,获取“扩展 'Python Language Basics' 无法格式化 ~'/'”
- vue.js - 如何将 ASP Core Web API VueJS 站点部署到 IIS
- groovy - 利用流出外部进程的返回值的问题
- java - 使用 java 来操作 minecraft 服务器输入/输出
- rust - 如果在 Rust book 20.3 中将发送 Terminate 消息和 thread.join() 放在一个循环中,为什么会出现死锁?
- python - Selenium python获取网站中资源(图像,脚本,css)的4xx和5xx列表
- c# - 打印item中item的索引
- javascript - 当我将 JavaScript 代码从站点 Action Nudge 复制粘贴到 Atom 时,它不对应?
- lua - 我将如何在 lua 中查找目录?