默认Android Studio项目的错误

时间:2016-03-23 15:27:39

标签: java android startup

当我在Android studio中创建标准(任何)项目并启动它时,我会遇到很多错误。

:app:clean
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2321Library
:app:prepareComAndroidSupportAppcompatV72321Library
:app:prepareComAndroidSupportSupportV42321Library
:app:prepareComAndroidSupportSupportVectorDrawable2321Library
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources
:app:mergeDebugResources
:app:processDebugManifest
:app:processDebugResources
:app:generateDebugSources
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestAidl
:app:processDebugAndroidTestManifest
:app:compileDebugAndroidTestRenderscript
:app:generateDebugAndroidTestBuildConfig
:app:generateDebugAndroidTestAssets UP-TO-DATE
:app:mergeDebugAndroidTestAssets
:app:generateDebugAndroidTestResValues UP-TO-DATE
:app:generateDebugAndroidTestResources
:app:mergeDebugAndroidTestResources
:app:processDebugAndroidTestResources
:app:generateDebugAndroidTestSources
:app:preDebugUnitTestBuild UP-TO-DATE
:app:prepareDebugUnitTestDependencies
:app:mockableAndroidJar UP-TO-DATE
:app:compileDebugJavaWithJavac
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources
:app:buildInfoDebugLoader
:app:transformClassesWithExtractJarsForDebug
:app:transformClassesWithInstantRunVerifierForDebug
:app:transformClassesWithJavaResourcesVerifierForDebug
:app:mergeDebugJniLibFolders
:app:transformNative_libsWithMergeJniLibsForDebug
:app:processDebugJavaRes UP-TO-DATE
:app:transformResourcesWithMergeJavaResForDebug
:app:transformResourcesAndNative_libsWithJavaResourcesVerifierForDebug
:app:transformClassesWithInstantRunForDebug
:app:transformClasses_enhancedWithInstant+reloadDexForDebug
:app:incrementalDebugTasks
:app:prePackageMarkerForDebug
:app:coldswapKickerDebug
:app:fastDeployDebugExtractor
:app:generateDebugInstantRunAppInfo
:app:transformClassesWithInstantRunSlicerForDebug
:app:transformClassesWithDexForDebug
Error:java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0
Error:	at java.lang.ClassLoader.defineClass1(Native Method)
Error:	at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
Error:	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
Error:	at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
Error:	at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
Error:	at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
Error:	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
Error:	at java.security.AccessController.doPrivileged(Native Method)
Error:	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
Error:	at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
Error:	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
Error:	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
Error:	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
Error:Exception in thread "main" 
Error:java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0
Error:	at java.lang.ClassLoader.defineClass1(Native Method)
Error:	at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
FAILURE: Build failed with an exception.
Error:	at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
Error:	at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
* What went wrong:
Error:	at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
Execution failed for task ':app:transformClassesWithDexForDebug'.
Error:	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 1
Error:	at java.security.AccessController.doPrivileged(Native Method)
Error:	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
* Try:
Error:	at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Error:	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
Error:	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
Error:	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
Error:Exception in thread "main" 
Information:BUILD FAILED
Information:Total time: 3.238 secs
Error:java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0
Error:	at java.lang.ClassLoader.defineClass1(Native Method)
Error:	at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
Error:	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
Error:	at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
Error:	at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
Error:	at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
Error:	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
Error:	at java.security.AccessController.doPrivileged(Native Method)
Error:	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
Error:	at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
Error:	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
Error:	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
Error:	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
Error:Exception in thread "main" 
Information:44 errors

我的旧项目工作正常。使用A.S“make project”创建的新版本看起来没问题,但是当我在模拟器上启动它时它会启动,但我有超过100个控制台错误。

你能告诉我这里有什么问题,或者我必须重新安装吗?

1 个答案:

答案 0 :(得分:0)

你正在使用buildToolsVersion 24 RC1吗?如果是,请将其更改为' 23.0.2'并使用jdk 1.7进行编译