我正在研究某人创建的一个android项目。我在Android Studio中打开该项目后,出现错误:
错误:无法解决':app @ debug / compileClasspath'的依赖关系: 无法解析io.anyline:anylinesdk:5。
错误:无法解决以下项的依赖性 ':app @ debugAndroidTest / compileClasspath':无法解析 io.anyline:anylinesdk:5。
//Build.gradle of my project
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
android {
compileSdkVersion project.ext.compile_sdk_version
defaultConfig {
applicationId "com.xyz"
minSdkVersion 23
targetSdkVersion 26
versionCode 5
versionName "1.0.4"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
ndk {
abiFilters 'armeabi-v7a'
}
multiDexEnabled true
}
sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/TrainedModels'] } }
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
repositories {
flatDir {
dirs 'libs'
}
maven {
url 'https://anylinesdk.blob.core.windows.net/maven/'
}
mavenCentral()
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
implementation "com.android.support:support-v4:$support_version"
implementation "com.android.support:appcompat-v7:$support_version"
implementation "com.android.support:design:$support_version"
implementation "com.android.support:cardview-v7:$support_version"
implementation "com.android.support:preference-v14:$support_version"
implementation 'com.github.bumptech.glide:glide:3.8.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation "com.squareup.retrofit2:adapter-rxjava2:2.3.0"
androidTestImplementation 'com.android.support.test:runner:1.0.2'
implementation 'io.anyline:anylinesdk:5@aar'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.googlecode.libphonenumber:libphonenumber:7.2.2'
//
implementation ('com.google.android.gms:play-services-base:11.6.0'){
force=true
}
implementation ('com.google.android.gms:play-services-auth-api-phone:11.6.0'){
force=true
}
//Optional for phone number hint
implementation ('com.google.android.gms:play-services-auth:11.6.0'){
force=true
}
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
repositories {
mavenCentral()
}
有人可以帮助我吗?
答案 0 :(得分:1)
这里的问题是Anyline SDK集成
将Anyline SDK添加到build.gradle中的依赖项
repositories {
//add the anyline maven repo
maven { url 'https://anylinesdk.blob.core.windows.net/maven/'}
}
dependencies {
//add the anyline sdk as dependency (maybe adapt version name)
compile 'io.anyline:anylinesdk:3.6.1@aar'
//... your other dependencies
}
或通过aar的本地副本
将.aar复制到项目的libs目录(app / libs),并修改build.gradle。
将Anyline SDK添加到build.gradle中的依赖项
//root section of the file
repositories {
flatDir {
dirs 'libs'
}
}
dependencies {
compile(name:'anylinesdk-3.6.1', ext:'aar')
//... your other dependencies
}
希望这会解决.....
答案 1 :(得分:0)
首先清理项目(build-> clean项目) 然后迁移到android x(重构->迁移到androidx) 允许更改android studio建议的更改
答案 2 :(得分:0)
错误已解决。AndroidStudio现在可以下载任意行的sdk。发生此错误是因为网址“ https://anylinesdk.blob.core.windows.net/maven/”已被我公司的ITSEC屏蔽。
感谢您的帮助