我在Windows 7 x64上安装Android studio 0.4.2。尝试从工作室创建简单的项目,但我收到一个错误:
Cannot inherit from final class
在我的虚拟机XPx32中,所有这些文件a-studio完美运行(我只是复制android-studio,c:\ Users \%user%。AnroidStudioPreview,c:\ Users \%user%.gradle from my real vachine进入虚拟)。
我在ntlm的代理服务器后面。
日志是:
2014-01-19 12:31:20,504 [ 22420] WARN - nal.AbstractExternalSystemTask - Cannot inherit from final class
com.intellij.openapi.externalSystem.model.ExternalSystemException: Cannot inherit from final class
at org.jetbrains.plugins.gradle.service.project.GradleExecutionHelper.execute(GradleExecutionHelper.java:185)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:113)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:61)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:41)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:49)
at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:48)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:137)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:123)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:471)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$4$2.run(ExternalSystemUtil.java:549)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:464)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:178)
at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:171)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$8.run(ProgressManagerImpl.java:373)
at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:436)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:153)
已更新
在我的项目3个子项目中。 顶级build.gradle
// 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.7.+'
}
}
allprojects {
repositories {
mavenCentral()
}
}
主项目build.gradle
apply plugin: 'android'
android {
compileSdkVersion 18
buildToolsVersion "19.0.1"
defaultConfig {
minSdkVersion 15
targetSdkVersion 18
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile project(':wheel')
compile project(':appRater')
compile files('libs/android-support-v13.jar')
compile files('libs/libGoogleAnalyticsServices.jar')
}
在所有子项目中,build.gradle是:
apply plugin: 'android-library'
android {
compileSdkVersion 18
buildToolsVersion "19.0.1"
defaultConfig {
minSdkVersion 15
targetSdkVersion 18
}
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
答案 0 :(得分:6)
似乎android studio中的一个错误不具体但与
有关Cannot inherit from final Class
如果它也解决了你的问题,请在下面报告的错误中尝试评论#9。
现在开始链接
https://code.google.com/p/android/issues/detail?id=63953
#comment9
关闭Android Studio,进行备份并从工作室设置目录中删除所有这些文件并重新启动,可能会对您有所帮助
android-studio/plugins/android/lib/builder-0.6.1.jar
android-studio/plugins/android/lib/builder-model-0.6.1.jar
android-studio/plugins/gradle/lib/gradle-base-services-1.8.jar
android-studio/plugins/gradle/lib/gradle-build-setup-1.8.jar
android-studio/plugins/gradle/lib/gradle-core-1.8.jar
android-studio/plugins/gradle/lib/gradle-messaging-1.8.jar
android-studio/plugins/gradle/lib/gradle-native-1.8.jar
android-studio/plugins/gradle/lib/gradle-plugins-1.8.jar
android-studio/plugins/gradle/lib/gradle-tooling-api-1.8.jar
android-studio/plugins/gradle/lib/gradle-wrapper-1.8.jar
android-studio/plugins/gradle/lib/guava-11.0.2.jar
答案 1 :(得分:0)
除了上面的答案之外,在删除文件之前,我打开了破坏的项目,Android Studio告诉我gradle已经过时了,并且消息中有一个小URL说明了修复gradle ...这样做了一些东西,但并没有完全解决我的问题。之后,我删除了上面的文件,一切正常。