我是初学者,在 Android Studio 中遇到此错误:-
Error:(26, 13) Failed to resolve: com.android.support:appcompat-v7:30.0.0 Install Repository and sync project
Show in File
Show in Project Structure dialog
这是我的 gradle 代码:-
apply plugin: 'com.android.application'
android {
compileSdkVersion 30
buildToolsVersion "30.0.0"
defaultConfig {
applicationId "com.example.piyushbairagi.demoapp"
minSdkVersion 15
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
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:30.0.0'
testCompile 'junit:junit:4.12'
}
我正在使用 Android Studio 2.2.1 版本进行学习。任何帮助将不胜感激。
最佳答案
这是因为支持库 v.30
不要存在。
使用 安卓x 图书馆:
implementation 'androidx.appcompat:appcompat:1.1.0'
或使用最后一个支持库:
implementation 'com.android.support:appcompat-v7:28.0.0'
关于android - 无法解析 : com. android.support :appcompat-v7:30. 0.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62416064/