无法解决:com.android.support:appcompat-v7 24.0.1 [英] Failed to resolve: com.android.support:appcompat-v7 24.0.1
问题描述
我已经搜索了很多东西,但是我找不到真正可以帮助我成为android新手的帖子,所以其中一些让我感到头疼.无论如何,当我收到错误消息说gradle插件很旧并且同步无法完成时,我的问题就开始了.所以我改变了一些不确定的事情,不确定自己做了什么.现在我有:
I have searched around a lot but I cannot really find a post that helps I am somewhat new to android so some of this goes over my head. Anyway, my problems started when I got an error saying gradle plugin was old and the sync would not complete. So I changed a few things around not really sure what I did. Now I have:
错误(25,13)无法解决:com.android.support:appcompat-v7 24.0.1
Error(25,13) Failed to resolve: com.android.support:appcompat-v7 24.0.1
项目gradle文件:
Project gradle file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
应用gradle文件:
app gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.bisesifreelance.maxbisesi.tic_tac_toe"
minSdkVersion 23
targetSdkVersion 24
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:24.0.1'
testCompile 'junit:junit:4.12'
}
我还已经在SDK管理器中安装了所有构建工具,但我还不允许嵌入图像吗?但它说:
Also I have installed all build tools in SDK manager I'm not allowed to embed images yet? but it says:
已安装Android SDK Plaform-Tools 24.03
Android SDK Plaform-Tools 24.03 installed
已安装Android SDK工具25.2.2
Android SDK Tools 25.2.2 installed
谢谢!我很迷茫.
推荐答案
尝试
compile 'com.android.support:appcompat-v7:24.2.1'
编辑
对于sdk 27
For sdk 27
buildToolsVersion "27.0.3"
implementation "com.android.support:appcompat-v7:27.1.1"
这篇关于无法解决:com.android.support:appcompat-v7 24.0.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!