Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
159 views
in Technique[技术] by (71.8m points)

android - problems after installing java 8

Android Studio had a popup telling updates was available after i run the SDK manager and started the Android Studio again I got another popoup that toke me to Androids website where it told me that I should upgrade to Java JDK 8 and JRE 8 after I did i got over 235 errors when try to run the debug. I uninstalled version 8 and reinstalled 7u80 JDK and JRE now I'm down to 34 errors. When I type java -version I get 1.8.073 here are all 35 errors.

    Error:java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0
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.defineClass1(Native Method)
Error:  at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
Error:  at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
Error:  at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
Error:  at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
Error:  at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
Error:  at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
Error:  at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
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:361)
Error:  at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
Error:  at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
Error:  at java.security.AccessController.doPrivileged(Native Method)
Error:  at java.security.AccessController.doPrivileged(Native Method)
Error:  at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
Error:  at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
Error:  at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
Error:  at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
Error:  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
Error:  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
Error:  at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
Error:  at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
Error:  at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
Error:  at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
Error:Exception in thread "main" 
Error:Exception in thread "main" 
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> 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 FilesJavajdk1.7.0_80injava.exe'' finished with non-zero exit value 1

Here is the Gradel.build

android {
    compileSdkVersion 23
    buildToolsVersion '24.0.0 rc1'
    defaultConfig {
        applicationId "com.kim.printer"
        minSdkVersion 21
        targetSdkVersion 23
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
    productFlavors {
    }
}

dependencies {
    compile 'com.google.android.gms:play-services-gcm:8.4.0'
    compile 'com.google.code.gson:gson:2.4'
    compile "com.android.support:support-v4:23.1.0"
    compile "com.android.support:support-v13:23.1.0"
    compile "com.android.support:cardview-v7:23.1.0"
    compile 'com.android.support:appcompat-v7:23.0.0'
    compile files('libs/StarIOPort3.1.jar')
    compile files('libs/StarIO_Extension.jar')
}

Thanks for any help I have been working on this for 6 hours and I can get it to compile.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The problem is in the buildToolsVersion '24.0.0 rc1' after changing it to '23.0.2' I no longer get errors.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...