Android Studio编译失败:Caused by: java.lang.RuntimeException: Android dependency com.android.support:ap
16lz
2021-01-23
Android Studio编译报错:
Caused by: java.lang.RuntimeException: Android dependency 'com.android.support:appcompat-v7' has different version for the compile (25.3.1) and runtime (27.1.1) classpath. You should manually set the same version via DependencyResolution at com.android.build.gradle.internal.tasks.AppPreBuildTask.lambda$run$0(AppPreBuildTask.java:104) at com.android.build.gradle.internal.tasks.AppPreBuildTask.handleArtifact(AppPreBuildTask.java:119) at com.android.build.gradle.internal.tasks.AppPreBuildTask.run(AppPreBuildTask.java:90) |
命令行中执行如下命令查看详细报错(需先切换到当前工程目录下):
Windows: gradlew clean build --stacktrace
MAC/Linux: ./gradlew clean build --stacktrace
查看详细的报错,发现存在如下报错:
* What went wrong: Execution failed for task ':app:preDebugBuild'. > Android dependency 'com.android.support:appcompat-v7' has different version for the compile (25.3.1) and runtime (27.1.1) classpath. You should manually set the same version via DependencyResolution |
解决方案:
统一com.android.support:appcompat-v7,按照提示中的版本号修改,将25.3.1修改为27.1.1
关注头条号,第一时间获取最新文章:
更多相关文章
- Android中执行adb命令
- Android中的获取内存信息的相关命令
- Android笔记1——Android SDK自带的工具和命令
- Android 内存分析命令
- Android中使用代码执行shell命令
- Android 获取应用的icon、名字、版本号
- Android pm命令使用方法
- Android开发常用的linux命令、命令行操作、抓包等