【发布时间】:2017-01-23 23:25:34
【问题描述】:
我已经搜索了很多,但我真的找不到可以帮助我对 android 有点陌生的帖子,所以其中一些内容超出了我的想象。无论如何,当我收到一个错误说 gradle 插件太旧并且同步无法完成时,我的问题就开始了。所以我改变了一些东西,不太确定我做了什么。现在我有:
错误(25,13)无法解决:com.android.support:appcompat-v7 24.0.1
项目 gradle 文件:
// 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 文件:
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 管理器中安装了所有构建工具,我还不允许嵌入图像吗?但它说:
已安装 Android SDK Plaform-Tools 24.03
已安装 Android SDK 工具 25.2.2
谢谢你!我很迷茫。
【问题讨论】:
-
不要忘记为 android studio 运行更新以获取 V 24 的 API
-
@madmax 你能解决你的问题吗?它得到了同样的错误
-
@mahdi pisguy 如果我记得正确 Tiagos 解决方案最终帮助我找到了我的错误
-
如果你仍然有这个问题,你也可以检查那个解决方案,stackoverflow.com/questions/49140950/…