我是初学者,在Android中得到了这个错误:-
错误:(26,13)未能解决: com.android.support:appcompat-v7:30.0.0安装存储库和同步项目 在文件中显示 在项目结构中显示对话框
这是我的等级代码:-
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'
}
我使用AndroidStudio2.2.1版本来学习。任何帮助都会很感激。
发布于 2020-06-16 19:29:02
这是因为支持库v.30
不存在。
使用androidx库:
implementation 'androidx.appcompat:appcompat:1.1.0'
或者使用最后一个支持库:
implementation 'com.android.support:appcompat-v7:28.0.0'
发布于 2020-07-07 06:29:11
android.useAndroidX=true
android.enableJetifier=true
您可以将这些添加到gradle.properties文件中,这将很好地工作。我有同样的问题,并添加这些删除了错误。还可以尝试更新Android的所有插件和组件。
发布于 2020-06-16 21:35:01
支持库的最新版本是28.0.0
。
因此,您必须按以下方式更新您的build.gradle
:
compile 'com.android.support:appcompat-v7:28.0.0'
支助图书馆已经停用。所以,不要期望在28.0.0
之后有任何新的版本。
谷歌现在支持AndroidX。在某种程度上(也是基本的),是一样的。因此,为了得到Google的支持,您可能需要考虑将应用程序迁移到Android。
有关Android的更多信息:
https://stackoverflow.com/questions/62416064
复制相似问题