Status Update
Comments
lu...@google.com <lu...@google.com>
je...@google.com <je...@google.com>
am...@google.com <am...@google.com> #2
am...@google.com <am...@google.com> #4
for all who are looking for a solution use this:
ro...@sentry.io <ro...@sentry.io> #5
Alright, I've just tried to apply my plugin to
Unable to find common super type for androidx/window/sidecar/SidecarDeviceState and androidx/window/sidecar/SidecarInterface.
Unable to find common super type for androidx/window/sidecar/SidecarDeviceState and androidx/window/sidecar/SidecarInterface.
Unable to find common super type for androidx/window/sidecar/SidecarInterface and java/lang/Object.
Unable to find common super type for androidx/window/sidecar/SidecarDeviceState and java/lang/Object.
Unable to find common super type for java/lang/Class and androidx/window/sidecar/SidecarInterface.
Unable to find common super type for androidx/window/layout/SafeWindowLayoutComponentProvider and androidx/window/extensions/layout/WindowLayoutComponent.
Unable to find common super type for androidx/window/extensions/layout/WindowLayoutComponent and java/lang/Object.
After checking
Isn't it a valid use-case and no warning should be printed in this case?
am...@google.com <am...@google.com> #6
The common super type should be Object
if the classes were loaded correctly, I assume that in that case the androidx library is not on the classpath. I can take a look into this to double check. So to reproduce you are using a plugin that registers an asm visitor to instrument the now-in-android app? with no modification to the app code?
ro...@sentry.io <ro...@sentry.io> #7
Ok, I dug a little bit more into this - turns out the cause is the asm-commons
. I've put up a reproducer for you
./gradlew app:assembleDebug --console=plain
And you should see the warnings from above.
Without the ClassRemapper
(e.g. just a simple ClassVisitor
instead) I wasn't seeing those warnings.
I'm not sure whether the issue is on the ASM or AGP's site. I also noticed (as you mentioned), that androidx.window
actually compileOnly
, and they should be now-in-android
indeed does not contain those dependencies in the tree.
ro...@sentry.io <ro...@sentry.io> #8
Sorry for pinging you, but have you had a chance to look into this? Thanks
am...@google.com <am...@google.com> #9
Hi, sorry for taking so long to look into this. I've merged a now-in-android
app with your reproducer
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:
> androidx.window.sidecar.SidecarDeviceState
> androidx.window.sidecar.SidecarInterface
> androidx.window.extensions.layout.WindowLayoutComponent
The change should land in AGP 8.0 alpha-04.
ke...@gmail.com <ke...@gmail.com> #11
I have faced this issue too, and fixed just by adding missing rules from {your_build}/output/missing_rules.txt
file into proper proguard_rules.pro
file. You can find this type of error message and path to missing_rules.txt
file in build logs.
For example, in my case, there were missing.
-dontwarn com.google.android.material.R$id
-dontwarn org.bouncycastle.jsse.BCSSLParameters
-dontwarn org.bouncycastle.jsse.BCSSLSocket
-dontwarn org.bouncycastle.jsse.provider.BouncyCastleJsseProvider
-dontwarn org.conscrypt.Conscrypt$Version
-dontwarn org.conscrypt.Conscrypt
-dontwarn org.conscrypt.ConscryptHostnameVerifier
-dontwarn org.openjsse.javax.net.ssl.SSLParameters
-dontwarn org.openjsse.javax.net.ssl.SSLSocket
-dontwarn org.openjsse.net.ssl.OpenJSSE
Description
Using the new Instrumentation API, I noticed that sometimes I have the following messages when the instrumentation transforms run (this is just one example of those):
After checking the sources, I found out the warnings are being printed here , which gave me an impression that I cannot actually fix this on my site.
Some background on my instrumentation: I am looking at all classes (so not filtering anything in the
isInstrumentable
method) and then replacing some method calls with my static instrumented method calls. So I'd need those classes to be gone through theFixFramesClassWriter
as well.If there's nothing I can fix on my site, can this at least be an
info
ordebug
level log? It seems it doesn't affect the instrumentation or the runtime behavior of the app, so sounds like this can be avoided to pollute users' console log.Studio Build: N/A Version of Gradle Plugin: 7.2 Version of Gradle: N/A Version of Java: 11 OS: N/A