compileSdkVersion 太高问题
github2136 opened this issue · 11 comments
问题描述:
之前一直使用v8.1.5-jitpack,今天使用时突然提示
Could not determine the dependencies of task ':app:compileProtectDevDebugKotlin'.
Could not resolve all files for configuration ':app:protectDevDebugRuntimeClasspath'.
Could not find gsyVideoPlayer-ex_so-v8.1.5-jitpack.aar (com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-ex_so:v8.1.5-jitpack).
Searched in the following locations:
https://jitpack.io/com/github/CarGuo/GSYVideoPlayer/gsyVideoPlayer-ex_so/v8.1.5-jitpack/gsyVideoPlayer-ex_so-v8.1.5-jitpack.aar
Could not find gsyVideoPlayer-exo_player2-v8.1.5-jitpack.aar (com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-exo_player2:v8.1.5-jitpack).
Searched in the following locations:
https://jitpack.io/com/github/CarGuo/GSYVideoPlayer/gsyVideoPlayer-exo_player2/v8.1.5-jitpack/gsyVideoPlayer-exo_player2-v8.1.5-jitpack.aar
查看jitpack网站https://jitpack.io/com/github/CarGuo/GSYVideoPlayer/v8.1.5-jitpack/ 只剩一个build.log 编译失败的log
更新为com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-java:v8.1.9-release-jitpack后
又提示
Execution failed for task ':app:checkProtectDevDebugAarMetadata'.
Multiple task action failures occurred:
A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
The minCompileSdk (31) specified in a; dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties); is greater than this module's compileSdkVersion (android-28).Dependency: androidx.appcompat:appcompat:1.4.0.
能否在不升级compileSdkVersion、targetSdkVersion的情况下使用8.1.9版或者重新编译8.1.5版
GSY依赖版本
例如 implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-java:v8.1.5-jitpack'
v8.1.6-jitpack 不行? 8.1.5 是有问题。
解决方案:
1、你只需要升级 compileSdkVersion 31 , targetSdkVersion 可以不升级
2、或者你可以:
defaultConfig {
configurations.all {
resolutionStrategy { force 'androidx.appcompat:appcompat:1.3.0' }
}
v8.1.6-jitpack也有问题换v8.1.7-jitpack了
换compileSdkVersion 31就要换java11要改的地方有点多,
提示Multiple task action failures occurred:
A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
The minCompileSdk (31) specified in a; dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties); 有十来个个地方,换8.1.7暂时是最方便的了
@github2136 补充一下 还有一堆第三方中的要修改,很多也还没适配,暂时还在用8.1.7
@ZhuSky 还要
defaultConfig {
configurations.all {
resolutionStrategy { force 'androidx.appcompat:appcompat:1.3.0' }
}
我刚因为8.1.7的out of index升级了8.1.9,然后报错了,看提示主要是appcompat和core版本与我本地冲突,我做了exclude
implementation (rootProject.ext.gsyvideoPlayer){
exclude group: 'androidx.appcompat'
exclude group: 'androidx.core'
}
目前测试新版视频正常播放,也没编译报错了
PS 我刚测试了下,重新去平台上尝试了下:
implementation "com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer:8.1.5-jitpack"
com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-exo_player2:8.1.5-jitpack
com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-proxy_cache:8.1.5-jitpack
com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-armv64:8.1.5-jitpack
com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-x86_64:8.1.5-jitpack
com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-base:8.1.5-jitpack
com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-armv7a:8.1.5-jitpack
com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-java:8.1.5-jitpack
com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer:8.1.5-jitpack
com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-armv5:8.1.5-jitpack
com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-ex_so:8.1.5-jitpack
com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-x86:8.1.5-jitpack
这个应该可以依赖到,如下图所示:
A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction
java.lang.reflect.InvocationTargetException (no error message)
改了再编译就会出现这个问题
not implementation
compileSdk 23-33
gradle-7.6
在V8.4.0 里面基本上改不了 compileSdkVersion 只能用31的
没办法我用的是 8.3.5的 目前设置成29 是没问题的,可以正常编译通过,也可以正常运行
下面是我的 build.gradle的 部分配置
android {
compileSdkVersion 29 // 尝试先从 31 降级到30,然后运行成功之后 再降级到29
buildToolsVersion "33.0.2"
defaultConfig {
minSdkVersion 19
targetSdkVersion 29
multiDexEnabled true
…… //此处省略其他默认的配置
configurations.all {
resolutionStrategy { force 'androidx.appcompat:appcompat:1.3.0' }
}
compileOptions {
sourceCompatibility(JavaVersion.VERSION_1_8)
targetCompatibility(JavaVersion.VERSION_1_8)
}
…… //此处省略其他默认的配置
// 避免 lint 检测出错时停止构建
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar","*.aar"])
//[C、支持其他格式协议的(mpeg,rtsp, concat、crypto协议)] (https://github.com/CarGuo/GSYVideoPlayer/tree/master#c支持其他格式协议的mpegrtsp-concatcrypto协议)
implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-java:v8.3.5-release-jitpack',{
exclude group: 'androidx.appcompat'
exclude group: 'androidx.core'
}
//更多ijk的编码支持
implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-ex_so:v8.3.5-release-jitpack',{
exclude group: 'androidx.appcompat'
exclude group: 'androidx.core'
}
implementation 'com.github.CarGuo.GSYVideoPlayer:GSYVideoPlayer-exo2:v8.3.5-release-jitpack',{
exclude group: 'androidx.appcompat'
exclude group: 'androidx.core'
}
}