【发布时间】:2017-10-13 13:56:13
【问题描述】:
我正在开发条码扫描器的应用程序。
我的 Android Studio 版本是 2.3.3
我一直在 build.gradle (module:app) 中使用 compile,但我发现这个库建议使用 implementation 代替 compile。
我在网上搜索 compile 在 Android studio 3.0 中被 implementation 取代,但我必须在 Android studio 2.3.3 中使用这个库。
例子。
dependencies {
implementation 'com.budiyev.android:code-scanner:1.5.7'
}
当我把它放在我的 gradle 中时,它的显示错误。
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.budiyev.android:code-scanner:1.5.7' // HERE
testCompile 'junit:junit:4.12'
}
错误是:
Error:Failed to resolve: com.android.support:support-annotations:26.1.0
Install Repository and sync project
Show in Project Structure dialog
请告诉我如何在我的 android studio 2.3.3 中使用这个库
【问题讨论】:
标签: android android-gradle-plugin build.gradle