Hi KMP Team, I’ve run into a configuration cache ...
# multiplatform
v
Hi KMP Team, I’ve run into a configuration cache issue in KMP when using com.android.kotlin.multiplatform.library cache gets broken. I couldn’t find any information about it online based on error. I’ve reproduced it in a minimal, standard KMP sample project, which I can share. The issue first appeared on CI, where the build got stuck on the error below. After investigation, I was able to reliably reproduce it locally as well. I am running latest stable versions of all libraries. Error:
Copy code
Unable to load class 'Class 'com.android.build.api.attributes.BuildTypeAttr$Impl' not found in class loader 'InstrumentingVisitableURLClassLoader(ClassLoaderScopeIdentifier.Id{coreAndPlugins:settings[:]:buildSrc[:]:root-project[:](export)})' of type 'org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader'.'
Class 'com.android.build.api.attributes.BuildTypeAttr$Impl' not found in class loader 'InstrumentingVisitableURLClassLoader(ClassLoaderScopeIdentifier.Id{coreAndPlugins:settings[:]:buildSrc[:]:root-project[:](export)})' of type 'org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader'.
Steps to reproduce (100% reproducible), i would guess force serialized configuration cache to be used: 1. Open the attached project in Android Studio in my case Narwhal Feature Drop on windows. 2. Run App for Android target, might be needed few times until all tasks are always up to date. 3. Close Android Studio. 4. Start it again and try to build — it will get permanently stuck with the error above until you invalidate configuration cache. The issue does not occur if com.android.kotlin.multiplatform.library is replaced with com.android.library (with proper configuration). That’s the workaround I’m currently using in our project. It’s possible I’m missing something obvious — any insights or help would be greatly appreciated!
z
Sounds like the issue is within the plugin from the AGP team. Could you please file an issue on issuetracker.google.com? If you link it here, I'll ping them to be sure to take a look.
v
I couldn’t report it under AGP due to lack of permissions, so I submitted it under the closest public option: Android Studio. Here is link https://issuetracker.google.com/issues/438933780 Thx!
thank you color 1
t
fyi @Hakan Mehmed