0

I'm trying to implement baseline profile with macrobenchmark to speed up release build.

I based my implementation on https://developer.android.com/studio/profile/baselineprofiles

and this commit of their jetSnack demo application https://github.com/android/compose-samples/commit/cadc6d189dc841b0935684e9fb07c396eacedda7

however, my project uses dynamic feature modules, and every time I run the application it crashes on exception

java.util.ServiceConfigurationError: mypackage.feature.entry.EntryFeature: Provider mypackage.feature.entry.di.EntryFeatureImpl not found

I added -dontobfuscate into proguard rules as per commits above, yet the features aren't loading, if I just run release version it works fine, do I need to initialize them somehow manually ? Does anyone have any experience with this ? Official documentation on DFM is particularly poor on this one, thanks

mlykotom
  • 4,850
  • 1
  • 22
  • 27
Hessesian
  • 51
  • 2
  • There are a lot of moving parts in this question. Can you provide a sample to reproduce this issue? Otherwise it's hard to debug what is actually going wrong. Generally, baseline profiles doesn't strip away code and shouldn't be able to cause this crash. – Ben Weiss Aug 05 '22 at 08:39
  • Same issue here, it looks like when we run benchmark task, the task didn't include the dynamic feature code into our application, basically it will use app bundle(aab) instead of apk. So if the class is not included in your base.apk, then it will throw a classnotfound exception. But I neither don't know how to fix it. – Jian Guo Aug 17 '22 at 09:37

0 Answers0