我更新了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) resize2fs 1.42.13 (17-May-2015)
The filesystem is already 140800 (4k) blocks long. Nothing to do!
当我尝试运行AVD时出现错误.
我正在使用Mac,我已经完成了SDK Manager的所有必要更新.
有谁知道可能是什么?
我知道在Java中我们使用final
关键字变量或其他东西来使其值不被改变.
final
在下面的例子中使用有什么区别?
public class MainActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final TextView campoTexto = (TextView) findViewById(R.id.campoTexto);
Button botaoTexto = (Button) findViewById(R.id.botaoTexto);
Button botaoCor = (Button) findViewById(R.id.botaoCor);
final RelativeLayout fundoTela = (RelativeLayout) findViewById(R.id.fundoTela);
Run Code Online (Sandbox Code Playgroud)