昨天将Android Studio升级到0.8.1, 竟然没法执行App了~
Run窗口中显示:
Waiting for device.
Target device: lge-nexus_4-0262fa6d9d51c2e8
Event Log窗口显示:
NoSuchMethodError: com.android.builder.model.AndroidArtifact.getOutputs()Ljava/util/Collection;: com.android.builder.model.AndroidArtifact.getOutputs()Ljava/util/Collection;
折腾了很久, 不得要领. 后来想起Android Studio是采用解压安装包, 并覆盖原有目录方式升级的, 那么可能会是某个文件存在'新旧冲突'的可能. 于是一个个检查文件的时间戳, 发现只要在Android Studio目录下删除下面'旧'文件, 重启即可.
\android-studio\plugins\android\lib\builder-model-0.11.0.jar
因为Android Studio 0.8.1的Gradle用的是0.12.+了..
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.+'// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}allprojects {
repositories {
mavenCentral()
}
}
<---- No Google Service ---->
唉, 何时Google Service才能畅快访问啊...