dee*_*s91 9 android gradle android-gradle-plugin
当我构建应用程序
./gradlew assembleRelease
时,我收到此警告:
ASM Instrumentation process wasn't able to resolve some classes, this means that
the instrumented classes might contain corrupt stack frames. Make sure the
dependencies that contain these classes are on the runtime or the provided
classpath. Otherwise, the jvm might fail to load the corrupt classes at runtime
when running in a jvm environment like unit tests.
Classes that weren't resolved:
> sun.misc.Unsafe
> androidx.appcompat.view.ContextThemeWrapper
> com.google.common.util.concurrent.ListenableFuture
> retrofit2.Response
> javax.mail.internet.MimeBodyPart
> javax.naming.NamingException
> javax.naming.directory.Attributes
Run Code Online (Sandbox Code Playgroud)
我目前使用的是 AGP 8.0.1
在之前的 AGP 版本 (7.4.2) 中,警告的措辞有所不同:
Unable to find common super type for java/lang/reflect/Field and sun/misc/Unsafe.
Unable to find common super type for sun/misc/Unsafe and java/lang/Object.
Unable to find common super type for com/google/android/gms/internal/measurement/zznt and sun/misc/Unsafe.
Unable to find common super type for androidx/appcompat/view/ContextThemeWrapper and android/content/Context.
Unable to find common super type for com/google/common/util/concurrent/ListenableFuture and androidx/work/InputMerger.
Unable to find common super type for java/lang/Throwable and retrofit2/Response.
Unable to find common super type for java/lang/Exception and javax/mail/internet/MimeBodyPart.
Unable to find common super type for javax/naming/NamingException and javax/naming/directory/Attributes.
Unable to find common super type for java/lang/Object and javax/naming/directory/Attributes.
Unable to find common super type for java/lang/reflect/Field and sun/misc/Unsafe.
Unable to find common super type for sun/misc/Unsafe and java/lang/Object.
Unable to find common super type for com/google/android/recaptcha/internal/zzjo and sun/misc/Unsafe.
Unable to find common super type for java/lang/reflect/Field and sun/misc/Unsafe.
Unable to find common super type for sun/misc/Unsafe and java/lang/Object.
Unable to find common super type for com/google/android/gms/internal/firebase-auth-api/zzaje and sun/misc/Unsafe.
Run Code Online (Sandbox Code Playgroud)
我怀疑消息更改与https://issuetracker.google.com/issues/231997058有关,但我仍然不知道如何修复此警告
我是这个问题的最初报道者,我认为作为用户,你没有什么可做的。某些库将其依赖项声明为,compileOnly并且当 ASM 工具尝试解析这些compileOnly依赖项中的类型(而它们在运行时不存在)时,会打印此警告。
但是,如果声明compileOnly依赖项的库具有适当的运行时检查,甚至不会从该依赖项调用类(如果它不存在于类路径中),那么这本身并没有问题。
但我认为可能值得在 google tracker 上 ping 这个问题,因为我也认为打印此警告没有意义,特别是在像这样的情况下
Unable to find common super type for sun/misc/Unsafe and java/lang/Object.
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1600 次 |
| 最近记录: |