Android(安卓)Studio JDK版本问题报错
16lz
2022-01-25
Android Studio import包后就报错,是因为JDK版本问题
报错:
Error:Error converting bytecode to dex:
Cause: Dex cannot parse version 52 byte code.This is caused by library dependencies that have been compiled using Java 8 or above.
If you are using the 'java' gradle plugin in a library submodule add
targetCompatibility = '1.7'
sourceCompatibility = '1.7'
to that submodule's build.gradle file.
解决办法:
在project下的build.gradle改成这样:
buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.1.0' apply plugin: 'java' sourceCompatibility = 1.7 targetCompatibility = 1.7 }}
在app文件夹下的build.gradle改成这样: 更多相关文章
- Android版本检测与更新
- android获取versionName和versionCode
- android studio 用cmake编译报错
- android分享应用工具类
- 【Android】高德地图2DMap,隐藏“高德地图”logo样式(不同版本或有
- Android(安卓)Glide 升级4.8 后, 原方法error/preload/fallback
- android版本自动检测更新 版本检测 自动更新 自动安装
- 同一功能在Android不同版本进行兼容的方法
- android EditText的自动换行和对Enter键的改变