gpt4 book ai didi

android - 找不到与 com.android.support :support-v7:20. 0.+ 匹配的任何版本

转载 作者:太空宇宙 更新时间:2023-11-03 13:21:00 24 4
gpt4 key购买 nike

我是安卓开发的新手我写过

classpath 'com.android.tools.build:gradle:1.0.0+'

runproduard() is replaced with minifyenabled. The result : Build successful

但是在运行时出现了这个错误:

我的代码是:

compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.+'
compile 'com.android.support:support-v4:21.0.+'

但是 698 条警告,因为找不到在 libs 文件夹中添加的引用类 xom

Error:Execution failed for task ':app:proguardMobifoodDemoDebug'. java.io.IOException: Please correct the above warnings first.

我的android studio版本是1.0.2,gradle版本是2.2.1

最佳答案

模块目录下的build.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.+'
compile 'com.android.support:support-v4:21.0.+'
}

“+”允许 gradle 自动升级到 jar 的最新错误修复版本。

最外层工程目录下的build.gradle

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
jcenter()
}
}

本地.properties

sdk.dir=/Tools/adt-bundle-mac-x86_64-20140624/sdk

关于android - 找不到与 com.android.support :support-v7:20. 0.+ 匹配的任何版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27654979/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com