Status Update
Comments
ra...@google.com <ra...@google.com> #2
error instantiating androidx.tracing.perfetto.StartupTracingConfigStoreIsEnabledGate
This looks like a minification issue
- Are you using either minification of your app, or in your instrumented test? If so, can you try adding a keep rule for that class?
- Is this class present in your apk's dex files, if you open the apk in studio? (if this is an instrumented test, check both your app and test)
- Are you depending on
androidx.compose.runtime:runtime-tracing
viaandroidTestImplementation
orimplementation
, and from what type of module? - What version of AGP are you using? I would expect the
would mean the library doesn't need an explicit keep rule, but it could bemanifest entry for this class depending on your AGP version / how the dependency is declared (fixed in AGP 8.6 canary 5, but a keep rule should work around it)b/328649293
Edit: disregard, I doubt Robolectric is using any of the minification codepaths.
al...@mercari.com <al...@mercari.com> #3
- Let me check
- Using
implementation
and it's added at the project level so all modules using compose are getting it - I'm on
8.1.1
ra...@google.com <ra...@google.com> #4
I would check the merged manifest using something like APK Analyzer
to make sure that is the case.
[Deleted User] <[Deleted User]> #5
ra...@google.com <ra...@google.com> #6
We should probably add some documentation here, but in general you should extend InitializationProvider
.
Something like:
package com.example
class SecondProvider: InitializationProvider()
Then to your AndroidManifest.xml you can add something like:
<provider
android:name="com.example.SecondProvider"
android:authorities="${applicationId}.androidx-startup-process2"
android:exported="false"
android:process=":process2"
tools:node="merge">
<!-- The components you want should be here. -->
<meta-data android:name="com.example.ExampleLoggerInitializer"
tools:node="remove" />
</provider>
jg...@google.com <jg...@google.com> #7
Rahul, I'm not sure I understand what's happening here. I understand Allan has added androidx.compose.runtime:runtime-tracing
to their app, which ships with
Am I right to understand that the issue stems from the app being a multi-process app and as a result App Startup in one process cannot find the initializer class that lives in the other process? And the
Or are you suggesting we should make a change in androidx.compose.runtime:runtime-tracing
to accommodate the multi-process scenario?
ra...@google.com <ra...@google.com> #8
We cannot account for the multi-process scenario given we don't know of their secondary processes (names et al). Unfortunately this is something they will have to do on their own.
ra...@google.com <ra...@google.com> #9
Am I right to understand that the issue stems from the app being a multi-process app and as a result App Startup in one process cannot find the initializer class that lives in the other process?
That is correct..
jg...@google.com <jg...@google.com> #10
Thanks Rahul!
Allan, can you confirm the workaround worked for you?
al...@mercari.com <al...@mercari.com> #11
Hey guys, thanks for checking this. I have just checked the merged manifest via APK Analyzer and there's no process defined, so it seems we're only using the default process. So I can't try the workaround to set to another process.
Is there anything else I could check from my side?
jg...@google.com <jg...@google.com> #12
Oh, we thought you're on multi-process based on your comment under
One thing I missed and just realised is that Android 10 is SDK 29 - we only support SDK 30+, so there is no benefit to add compose-runtime-tracing on API < 30. Still, the app should not crash and you shouldn't have to have different builds by API level.
Could you check, e.g. with APK Analyzer if the missing class (androidx.compose.runtime.tracing.TracingInitializer
) is present in the DEX
It might be easier - if possible - if you could share the APK with us - I'd be happy to have a look at it. Something I could run with Android Emulator running Android 10.
al...@mercari.com <al...@mercari.com> #13
Hi, btw
I can see TracingInitializer in the classes.dex file, and note it only crashes on some users' devices, not all Android 10 users.
I'll check if I can share APK here. In the meantime please let me know if there are other things I could check from my side.
jg...@google.com <jg...@google.com> #14
If you could give us the APK and repro steps it'd be ideal. Otherwise, it'd be difficult to know where to start.
Description
Component used: androidx.tracing Version used:1.1.0 Devices/Android versions reproduced on: Android 10, Sony, Samsung, etc
We are getting this crash on some users after we added tracing library.