如何在android项目中添加库?
当我要添加此库时:如何在android项目中添加库?,android,Android,当我要添加此库时: implementation 'com.daimajia.slider:library:1.1.5@aar' 我的android studio崩溃这是我的应用程序模块: android { compileSdkVersion 27 defaultConfig { applicationId "com.example.mahdi.introductionapps" minSdkVersion 15 tar
implementation 'com.daimajia.slider:library:1.1.5@aar'
我的android studio崩溃这是我的应用程序模块:
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.mahdi.introductionapps"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.daimajia.slider:library:1.1.5.
依赖关系:
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'de.hdodenhof:circleimageview:3.0.0'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.daimajia.slider:library:1.1.5@aar'
}
这是我的错误:
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.mahdi.introductionapps"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.daimajia.slider:library:1.1.5.
试着做这些事情
清理和重建项目
或
File>Invalidate Caches and Restart>Invalidate and Restart
或
取消选中Gradle Work Offline
尝试做这些事情
清理和重建项目
或
File>Invalidate Caches and Restart>Invalidate and Restart
或
取消选中渐变脱机工作
图书馆没有问题
图书馆没有问题