I’m having an issue with creating a library for An...
# library-development
m
I’m having an issue with creating a library for Android. When I add the library as a dependency then I’m not able to resolve top-level kotlin function. It looks like these functions are not even there, but I can see that they are there and I can even use them within java but not within kotlin. https://youtrack.jetbrains.com/issue/KT-38917 I have created an issue there but so far I didn’t get any response. I think that it is caused by missing some metadata but I’m not able to find which one. Can somebody help me with this issue?
l
@martinsumera Can you put your sample project on GitHub so we can peek at its configuration?
g
I’m not able to resolve top-level kotlin function.
Looks that @Metadata is removed, do you use R8/Proguard?
m
It was caused by missing `
Copy code
/META-INF/*.kotlin_module
I was able to solve it by adding this to packagingOptions https://stackoverflow.com/questions/61892974/im-not-able-to-use-top-level-functions-from-my-custom-kotlin-library
g
wow, so it’s AGP 4.1 bug
thanks for pointing this out
l
Fixed in AGP 4.1.0-alpha10, which I'm eagerly waiting for!