Android Studio 常见 Build 问题 Error:failed to find Build Tools revision 23.0.2

来源:互联网 发布:西安软件学校 编辑:程序博客网 时间:2024/04/30 11:27

问题一

有时候从 Github 上拷贝人家的工程,运行会出现各种依赖包、版本包问题。 
Build Tools revision

修改 build.gradle

在项目的 build.gradle 里面设置,注意有两个build.gradle,最好都注意一下。把build.gradle里面的版本改为自己能运行的工程里面版本号。

android {    compileSdkVersion 22    buildToolsVersion "23.0.0"    defaultConfig {        applicationId "com.example.administrator.seenews"        minSdkVersion 14        targetSdkVersion 22        versionCode 1        versionName "1.0"    }    buildTypes {        release {            minifyEnabled false            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'        }    }}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18

注意,如果有本地的库工程,需要把它们的build.gradle也修改了,比如下图的 library和 library_youku 
android

修改 File - Project Structure

在 Android Studio 里面选择 File 里面的 Project Structure,里面可以设置依赖版本。 
Android 
Android 
Android

参考文章

如何在Android Studio里设置Build Tool版本? http://bbs.csdn.net/topics/390980466

问题二

8:59:29 PM Gradle sync failed: Gradle DSL method not found: 'android()'           Consult IDE log for more details (Help | Show Log)
  • 1
  • 2
  • 1
  • 2

解决

最顶层的build.gradle 去掉 下面的代码

android {   compileSdkVersion 19   buildToolsVersion "19.1" }
  • 1
  • 2
  • 3
  • 4
  • 1
  • 2
  • 3
  • 4

参考文章

Android Studio Gradle DSL method not found: ‘android()’ — Error(17,0) http://stackoverflow.com/questions/27735646/android-studio-gradle-dsl-method-not-found-android-error17-0)

阅读全文
0 0