无法解析:com.android.support:appcompat-v7 24.0.1 [英] Failed to resolve: com.android.support:appcompat-v7 24.0.1

查看:26
本文介绍了无法解析: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:

Error(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 平台工具 24.03

Android SDK Plaform-Tools 24.03 installed

已安装 Android SDK 工具 25.2.2

Android SDK Tools 25.2.2 installed

谢谢你!我很失落.

推荐答案

try

  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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆