我已经从GitHub下载了Camera应用程序源代码。当我同步项目时,它将显示3错误。并且源代码还包含一些我不知道如何替换的依赖项。主要问题是androidX。
错误1
ERROR: Failed to resolve: com.github.ittianyu:BottomNavigationViewEx:1.1.9
Show in Project Structure dialog
Affected Modules: app
错误2
ERROR: Failed to resolve: com.github.eschao:android-ElasticListView:v1.0
Show in Project Structure dialog
Affected Modules: app
错误3
INFO: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed soon. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Affected Modules: app
build.gradle(模块:应用程序)文件-
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.cameraapplication"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
//Extra Dependency
testImplementation 'junit:junit:4.12'
//Design library for Coordinator Layout and Toolbars
implementation 'com.android.support:design:28.0.0'
//ExifInterface support
implementation 'com.android.support:exifinterface:28.0.0'
//design library for Coordinator Layout
implementation 'com.android.support:design:28.0.0'
//Exo Player
implementation 'com.google.android.exoplayer:exoplayer:2.10.5'
//cardview
implementation 'com.android.support:cardview-v7:28.0.0'
//recyclerview
implementation 'com.android.support:recyclerview-v7:28.0.0'
//BottomNavigationViewEx library
implementation 'com.github.ittianyu:BottomNavigationViewEx:1.1.9'
//Circle ImageView
implementation 'de.hdodenhof:circleimageview:2.2.0'
//elastic header
implementation 'com.github.eschao:android-ElasticListView:v1.0'
//material dialogs
implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
//glide
implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
implementation files('libs/aspectjrt-1.7.3 (1).jar')
//Universal image loader
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile files('libs/aspectjrt-1.7.3 (1).jar')
}
build.gradle(项目:CameraApplication)文件-
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
请告诉我解决方法 谢谢您提前
答案 0 :(得分:1)
错误:无法解决:com.github.ittianyu:BottomNavigationViewEx:1.1.9
错误:无法解决:com.github.eschao:android-ElasticListView:v1.0
在allprojects
块的顶层文件中,您必须添加jitpack存储库:
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
信息:配置'compile'已过时,并已由'implementation'和'api'代替。
删除此行
//compile files('libs/aspectjrt-1.7.3 (1).jar')
因为您已经在使用implementation fileTree(dir: 'libs', include: ['*.jar'])