Android 这里介绍了sdk3.14,打开minifyEnable时构建项目将失败
在这里介绍sdk3.14时,打开minifyEnable时构建项目失败。 这是原木Android 这里介绍了sdk3.14,打开minifyEnable时构建项目将失败,android,gradle,kotlin,proguard,Android,Gradle,Kotlin,Proguard,在这里介绍sdk3.14时,打开minifyEnable时构建项目失败。 这是原木 Unexpected error while performing partial evaluation: Class = [com/here/odnp/cell/PlatformCellManagerApi29] Method = [requestCellUpate(Z)V] Exception = [java.lang.IllegalArgumentException]
Unexpected error while performing partial evaluation:
Class = [com/here/odnp/cell/PlatformCellManagerApi29]
Method = [requestCellUpate(Z)V]
Exception = [java.lang.IllegalArgumentException] (Can't find common super class of [com/here/odnp/cell/PlatformCellManagerApi29$ImplicitCellInfoListener] (with 1 known super classes) and [com/here/odnp/cell/PlatformCellManagerApi29$ExplicitCellInfoListener] (with 1 known super classes))
Unexpected error while preverifying:
Class = [com/here/odnp/cell/PlatformCellManagerApi29]
Method = [requestCellUpate(Z)V]
Exception = [java.lang.IllegalArgumentException] (Can't find common super class of [com/here/odnp/cell/PlatformCellManagerApi29$ImplicitCellInfoListener] (with 1 known super classes) and [com/here/odnp/cell/PlatformCellManagerApi29$ExplicitCellInfoListener] (with 1 known super classes))
Warning: Exception while processing task java.io.IOException: java.lang.IllegalArgumentException: Can't find common super class of [com/here/odnp/cell/PlatformCellManagerApi29$ImplicitCellInfoListener] (with 1 known super classes) and [com/here/odnp/cell/PlatformCellManagerApi29$ExplicitCellInfoListener] (with 1 known super classes)
和我的build.gradle配置:
android {
compileSdkVersion(27)
buildToolsVersion("27.0.3")
defaultConfig {
applicationId = "com.sfic.extmse.operator"
minSdkVersion(19)
targetSdkVersion(22)
multiDexEnabled = true
versionCode = property("APP_VERSION_CODE").toString().toInt()
versionName = property("APP_VERSION_NAME").toString()
ndk {
abiFilters("armeabi", "x86", "armeabi-v7a")
}
}
buildTypes {
create("preRelease") {
isMinifyEnabled = true
isShrinkResources = false
isDebuggable = false
isJniDebuggable = false
isRenderscriptDebuggable = false
matchingFallbacks = listOf("release")
proguardFile(getDefaultProguardFile("proguard-android.txt"))
proguardFile(file("proguard-rules.pro"))
}
}
}
我尝试使用proguard来修复它:
# HERE
-dontwarn com.here.**
-keep class com.here.**{*;}
-dontoptimize
-dontshrink
但这是无用的
该项目使用android.support而不是androidx。我尝试将complieSdkVersion 27更改为29,it成功,但我无法更改对androidx的支持,因为我的依赖项使用支持即使您的依赖项尚未迁移,您仍然可以迁移到androidx,正如上所述-Jetifier将您的依赖项重写为使用androidx。但此项目使用分段,FragmentManager的实现在AndroidX和支持方面是不同的,因此我们不能临时迁移到AndroidX。是的,您可以。你总是在你的代码中使用AndroidX版本我尝试使用jetifier模式,但没有效果。即使你的依赖项尚未迁移,你仍然可以迁移到AndroidX,正如上所述-jetifier会像使用AndroidX一样重写你的依赖项。但此项目使用分段,FragmentManager的实现在AndroidX和支持方面是不同的,因此我们不能临时迁移到AndroidX。是的,您可以。你总是在你的代码中使用AndroidX版本,我尝试使用jetifier模式,但没有效果。