Hi everyone, Do you know how can i add an aar file...
# multiplatform
a
Hi everyone, Do you know how can i add an aar file (3rd party dependency) to one of my multi platform module for android platform side i tried to create an empty folder with that build.gradle file and aar file
Copy code
configurations.maybeCreate("default")
artifacts.add("default", file('3rd_party_sdk.aar'))
then i add that as a dependency to my mainAndroid dependency and it worked but now there are bunch of errors when syncing gradle which also ends with success but i cant use any code complation etc.
m
I just ran into this also. You have to set it up as a local maven repository. Create a maven repository in your repository section with a file URL. Then configure your directory structor how maven servers structure them. Need to include a pom file for it.
Comments here shows how to modify gradle. https://youtrack.jetbrains.com/issue/IDEA-274929
a
Thank you very much i ll look into it
Do you think i need .pom.md5 and .aar.md5 files as well ?
m
I didn’t use them
a
hmmm i did the folder structure put pom file and the aar file but gradle keep seying faild to resolve file 😞
m
Did you remove our old gradle project with the artifact and update the dependency to use normal dependencies (
api("group:artifact:version"
) instead of the project dependency?
a
thats how it looks like
and yes i removed the old ones
m
And what does the repository you added look like?
a
i forgot to send that sorry 🙂
m
Should probably be rootDir instead of projectDir
That’s all that I see different from what I did.
The not found message should list all the paths it tried for downloading, so you might be able to detect the problem that way.
You also need to specify the packaging in the pom file.
<packaging>aar</packaging>
The packaging line should fix that.
a
yes it fixed that 🙂
the references still not included but this is a different problem i guess
thnk you very much for you help
m
Should be possible to include the reference and source the same way you do the .aar file. I had no reference, so I skipped it.
a
its ok now that was just a corrupt file
thank you very much for you help 🙏
m
np
149 Views