1. Gradle version 2.2 is required. Current version is 2.10
解决方法:
1 . Open gradle-wrapper.properties
2 . Change this line:
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
with
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
3 . Go to build.gradle (Project: your_app_name)
4 . Change this line
classpath 'com.android.tools.build:gradle:XXX'
to this
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
or
classpath 'com.android.tools.build:gradle:1.5.0'
5 . Don’t click Sync Now
6 . From menu choose File -> Invalidate Caches/Restart…
7 . Choose first option: Invalidate and Restart
链接:https://stackoverflow.com/questions/34749299/gradle-version-2-2-is-r
equired-current-version-is-2-10
2.Error:java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0
问题原因:android studio同jdk版本不匹配
解决方案:
1.重装Java JDK
2.buildToolsVersion”24.0.1” 降到 buildToolsVersion”23.0.3” 重新编译
参考链接:http://www.cnblogs.com/ayixi/p/5830391.html
3.android studio 没有自带 httpClinet类库
解决办法:
就是在android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
}
后面加上 useLibrary 'org.apache.http.legacy',就没问题了。