I had no trouble using android studio 0.2.2, but then I upgraded to 0.3.6 then the issues started.
我在使用android studio 0.2.2时没有遇到任何困难,但之后我升级到了0.3.6,然后问题就开始了。
I tried searching other questions and found many common gradle issues, but haven't managed to find a solution that would fix this instance.
我尝试搜索其他问题,发现了许多常见的等级问题,但还没有找到解决这个问题的方法。
Error Output
Gradle: A problem occurred configuring project ':ComputerVision'.
> Failed to notify project evaluation listener.
> Could not resolve all dependencies for configuration ':ComputerVision:_DebugCompile'.
> Could not find any version that matches com.android.support:appcompat-v6:+.
Required by:
ComputerVisionProject:ComputerVision:unspecified
Gradle Code
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 7
targetSdkVersion 19
}
buildTypes {
release {
runProguard true
proguardFile getDefaultProguardFile('proguard-android-optimize.txt')
}
}
productFlavors {
defaultFlavor {
proguardFile 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:+'
}
Installed Packages
Let me know if you want to see the rest of it
2 个解决方案
#1
12
Look in the local.properties
file for your project and make sure it's pointed at the same Android SDK you installed the support repository for, and if it's not, install the support repository there. Android Studio installs its own local SDK, which can be confusing for existing Android developers who already have an SDK set up; we're working on improving life for those folks.
在当地。您的项目的属性文件,并确保它指向同一个Android SDK,您安装了支持存储库,如果不是,安装支持存储库。Android Studio安装了自己的本地SDK,这可能会让已经拥有SDK的现有Android开发人员感到困惑;我们正在努力改善这些人的生活。
If that doesn't work, then you could try uninstalling and reinstalling the support repository, and poking around and making sure the files are there and you have read permissions to them. The directory structure of mine looks like this:
如果这不起作用,那么您可以尝试卸载和重新安装支持存储库,并检查并确保这些文件在那里,并且您已经对它们进行了读权限。我的目录结构是这样的:
ls -lR ~/sdk/extras/android/m2repository/com/android/support/appcompat-v7/ total 24 drwxr-x---@ 8 sbarta admin 272B Oct 30 17:04 18.0.0 -rw-r-----@ 1 sbarta admin 40B Oct 30 17:05 maven-metadata.xml.sha1 -rw-r-----@ 1 sbarta admin 32B Oct 30 17:05 maven-metadata.xml.md5 -rw-r-----@ 1 sbarta admin 343B Oct 30 17:05 maven-metadata.xml drwxr-x---@ 8 sbarta admin 272B Oct 30 17:05 19.0.0 /Users/sbarta/sdk/extras/android/m2repository/com/android/support/appcompat-v7//18.0.0: total 1104 -rw-r-----@ 1 sbarta admin 40B Oct 30 17:04 appcompat-v7-18.0.0.pom.sha1 -rw-r-----@ 1 sbarta admin 32B Oct 30 17:04 appcompat-v7-18.0.0.pom.md5 -rw-r-----@ 1 sbarta admin 652B Oct 30 17:04 appcompat-v7-18.0.0.pom -rw-r-----@ 1 sbarta admin 40B Oct 30 17:04 appcompat-v7-18.0.0.aar.sha1 -rw-r-----@ 1 sbarta admin 32B Oct 30 17:04 appcompat-v7-18.0.0.aar.md5 -rw-r-----@ 1 sbarta admin 530K Oct 30 17:04 appcompat-v7-18.0.0.aar /Users/sbarta/sdk/extras/android/m2repository/com/android/support/appcompat-v7//19.0.0: total 1208 -rw-r-----@ 1 sbarta admin 40B Oct 30 17:05 appcompat-v7-19.0.0.pom.sha1 -rw-r-----@ 1 sbarta admin 32B Oct 30 17:05 appcompat-v7-19.0.0.pom.md5 -rw-r-----@ 1 sbarta admin 652B Oct 30 17:05 appcompat-v7-19.0.0.pom -rw-r-----@ 1 sbarta admin 40B Oct 30 17:05 appcompat-v7-19.0.0.aar.sha1 -rw-r-----@ 1 sbarta admin 32B Oct 30 17:05 appcompat-v7-19.0.0.aar.md5 -rw-r-----@ 1 sbarta admin 582K Oct 30 17:05 appcompat-v7-19.0.0.aar
#2
8
You need to upgrade your build tools...
You need to upgrade your build tools in the android SDK Manager (under Tools->Android->SDK Manager).
您需要在android SDK管理器(在工具-> android ->SDK管理器下)升级您的构建工具。
Next, you need to edit the build.gradle file in your src directory, and change the buildToolsVersion to the version you upgraded to.
接下来,需要编辑构建。您的src目录中的gradle文件,并将buildToolsVersion更改为您升级到的版本。
android {
compileSdkVersion 19
buildToolsVersion "19.0.1"
defaultConfig {
minSdkVersion 7
targetSdkVersion 19
}
}
#1
12
Look in the local.properties
file for your project and make sure it's pointed at the same Android SDK you installed the support repository for, and if it's not, install the support repository there. Android Studio installs its own local SDK, which can be confusing for existing Android developers who already have an SDK set up; we're working on improving life for those folks.
在当地。您的项目的属性文件,并确保它指向同一个Android SDK,您安装了支持存储库,如果不是,安装支持存储库。Android Studio安装了自己的本地SDK,这可能会让已经拥有SDK的现有Android开发人员感到困惑;我们正在努力改善这些人的生活。
If that doesn't work, then you could try uninstalling and reinstalling the support repository, and poking around and making sure the files are there and you have read permissions to them. The directory structure of mine looks like this:
如果这不起作用,那么您可以尝试卸载和重新安装支持存储库,并检查并确保这些文件在那里,并且您已经对它们进行了读权限。我的目录结构是这样的:
ls -lR ~/sdk/extras/android/m2repository/com/android/support/appcompat-v7/ total 24 drwxr-x---@ 8 sbarta admin 272B Oct 30 17:04 18.0.0 -rw-r-----@ 1 sbarta admin 40B Oct 30 17:05 maven-metadata.xml.sha1 -rw-r-----@ 1 sbarta admin 32B Oct 30 17:05 maven-metadata.xml.md5 -rw-r-----@ 1 sbarta admin 343B Oct 30 17:05 maven-metadata.xml drwxr-x---@ 8 sbarta admin 272B Oct 30 17:05 19.0.0 /Users/sbarta/sdk/extras/android/m2repository/com/android/support/appcompat-v7//18.0.0: total 1104 -rw-r-----@ 1 sbarta admin 40B Oct 30 17:04 appcompat-v7-18.0.0.pom.sha1 -rw-r-----@ 1 sbarta admin 32B Oct 30 17:04 appcompat-v7-18.0.0.pom.md5 -rw-r-----@ 1 sbarta admin 652B Oct 30 17:04 appcompat-v7-18.0.0.pom -rw-r-----@ 1 sbarta admin 40B Oct 30 17:04 appcompat-v7-18.0.0.aar.sha1 -rw-r-----@ 1 sbarta admin 32B Oct 30 17:04 appcompat-v7-18.0.0.aar.md5 -rw-r-----@ 1 sbarta admin 530K Oct 30 17:04 appcompat-v7-18.0.0.aar /Users/sbarta/sdk/extras/android/m2repository/com/android/support/appcompat-v7//19.0.0: total 1208 -rw-r-----@ 1 sbarta admin 40B Oct 30 17:05 appcompat-v7-19.0.0.pom.sha1 -rw-r-----@ 1 sbarta admin 32B Oct 30 17:05 appcompat-v7-19.0.0.pom.md5 -rw-r-----@ 1 sbarta admin 652B Oct 30 17:05 appcompat-v7-19.0.0.pom -rw-r-----@ 1 sbarta admin 40B Oct 30 17:05 appcompat-v7-19.0.0.aar.sha1 -rw-r-----@ 1 sbarta admin 32B Oct 30 17:05 appcompat-v7-19.0.0.aar.md5 -rw-r-----@ 1 sbarta admin 582K Oct 30 17:05 appcompat-v7-19.0.0.aar
#2
8
You need to upgrade your build tools...
You need to upgrade your build tools in the android SDK Manager (under Tools->Android->SDK Manager).
您需要在android SDK管理器(在工具-> android ->SDK管理器下)升级您的构建工具。
Next, you need to edit the build.gradle file in your src directory, and change the buildToolsVersion to the version you upgraded to.
接下来,需要编辑构建。您的src目录中的gradle文件,并将buildToolsVersion更改为您升级到的版本。
android {
compileSdkVersion 19
buildToolsVersion "19.0.1"
defaultConfig {
minSdkVersion 7
targetSdkVersion 19
}
}