compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
繼續上個打包, 又出現錯誤, 如下
Cause: com/android/build/gradle/internal/ide/DefaultAndroidProject has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
這個意思是說編譯代碼裡面或是引用的庫有55.0的版本, 但編譯環境的是 52.0的版本
查看了下 52 的是 Java8, 55 的是 Java11版本
安裝新版本並且更新 PATH, JAVA_HOME 環境變數後查看版本, 已經是新版本了
點開 Project Structure, 選擇 Module, 查看 Source Compatibility 發現是 Java8, 按下鍵只有 1.6、1.7、1.8 可以選擇, 強制填入 VERSION_1_11 會出錯。
這個跟 build.gradle 的 compileOptions 是一樣的, 修改也沒用
留言
張貼留言