Reputation: 3
im learning java via making Android App and cant fix Sync Error "Failed to resolve: androidx.appcompat:1.1.0:"
project build file here
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://maven.google.com/' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
app build file here
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.kayosystem.honki.chapter05.lesson21"
minSdkVersion 28
targetSdkVersion 29
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
//0608追加androidx.appcompat:appcompat:$appcompat_version
//0608取消compile 'com.android.support:appcompat-v7:24.+'
def appcompat_version = "1.1.0"
implementation "androidx.appcompat:$appcompat_version"
//For loading and tinting drawables on older versions of the platform
implementation "androidx.appcompat:appcompat-resources:$appcompat_version"
}
I have maven in both the build gradle of the project and the build gradle in the app file. This is because a synchronization error occurred when maven was written only in the build gradle of the project.
Upvotes: 0
Views: 309
Reputation: 5241
Change
implementation "androidx.appcompat:$appcompat_version"
to
implementation "androidx.appcompat:appcompat:$appcompat_version"
Upvotes: 2