这是我在Android Studio上的第一次尝试.我安装了0.8.0并更新到0.8.2.创建项目后,我收到错误消息:
错误:(1,0)找不到ID为'com.android.application'的插件
C:\用户\鲍勃\ AndroidStudioProjects\HelloAgain6 \程序\的build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.example.bob.helloagain6"
minSdkVersion 15
targetSdkVersion 20
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
Run Code Online (Sandbox Code Playgroud)
和C:\ Users\Bob\AndroidStudioProjects\HelloAgain6\build.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:0.12.+'
// NOTE: Do not place your …Run Code Online (Sandbox Code Playgroud) 我更新了Android Studio 2.0版并正常使用.当我今天创建一个新项目时,它显示错误插件太旧,请更新到更新的版本,或将ANDROID_DAILY_OVERRIDE环境变量设置为
我意识到只有在创建新项目时才会出现此问题.在之前开发的项目中,问题没有发生,我意识到gradle是不同的
classpath 'com.android.tools.build:gradle:1.3.0'.
我必须使用相同的旧项目更新?
我的app/build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "luizugliano.com.br.teste"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
}
Run Code Online (Sandbox Code Playgroud)
我的build.gradle(项目)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies …Run Code Online (Sandbox Code Playgroud) 我在这个问题中看到了这个词.我想我有一个想法,但不确定这是一个本地化的术语,还是该术语的广泛传播意义.
Shotgun会暗示他可能(过度)使用比更简单,更优雅的解决方案更笨重或更笨重的工具或技术.还有伏都教?
在运行我的项目时显示此错误,我尝试了所有可用的解决方案,但它不起作用.唯一剩下的就是设置ANDROID_DAILY_OVERRIDE环境变量,但我很难这样做.
我如何ANDROID_DAILY_OVERRIDE在mac上设置环境变量?
好的,假设您有一个应用程序,它是使用构建工具版本 21 构建的。现在,版本 24 已经发布。您的应用运行良好。但是,您的应用程序在构建时可能没有对构建工具进行优化和更改。
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
...
Run Code Online (Sandbox Code Playgroud)
我的问题是,有没有办法直接设置buildToolsVersion为最新版本。
您是否应该随着时间的推移更新构建工具。它有什么区别吗?
只是,要清楚,我并不是要征求意见。更多什么是处理构建工具更新时的标准模型。我应该等到我需要新版本的东西还是继续更新以进行优化