Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate class KtorfitExtKt found in modules moduleA and moduleB #86

Closed
miksto opened this issue Oct 31, 2022 · 1 comment
Closed

Duplicate class KtorfitExtKt found in modules moduleA and moduleB #86

miksto opened this issue Oct 31, 2022 · 1 comment

Comments

@miksto
Copy link

miksto commented Oct 31, 2022

Is your feature request related to a problem? Please describe.
I am working on a shared KMM library to be used in an Android app and an iOS app.
The project consists of several gradle modules, ModuleA and ModuleB, where both are using KtorFit to make requests to Api-A and Api-B.
Building the .aar's to be included in the Android project works fine, but when the shared library is included in the Android project the Android build fails with

Duplicate class de.jensklingenberg.ktorfit.KtorfitExtKt found in modules ModuleA and ModuleB

And when trying to build the iOS binary it fails with:

e: Compilation failed: IrSimpleFunctionPublicSymbolImpl for de.jensklingenberg.ktorfit/create|-6976474634225900979[0] is already bound: FUN name:create visibility:public modality:FINAL <T> ($receiver:<unbound IrClassPublicSymbolImpl>) returnType:T of de.jensklingenberg.ktorfit.create [inline]

It seems currently we are limited to only including Ktorfit 1 gradle module.

Describe the solution you'd like
I would like to be able to use Ktorfit in several gradle modules which are used for different features and API's, but i am currently unsure about what changes would be required for that.

If there is a workaround for this, please let me now. I'd also be happy to help out with implementing any required changes in Ktorfit, but could perhaps need some guidance on what is required.

@Foso
Copy link
Owner

Foso commented Jan 21, 2023

Hi @miksto , thank you for reporting. I needed some time to come up with a good fix for it. I changed how Ktorfit works under the hood, so this error should be fixed with https://github.com/Foso/Ktorfit/releases/tag/v1.0.0-beta17. I also started to document it more https://github.com/Foso/Ktorfit/blob/master/docs/architecture.md and created a issue for Ktorfit development

@Foso Foso closed this as completed Jan 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants