https://kotlinlang.org logo
f

Fanis Paschos

11/03/2020, 10:15 PM
Hello everyone, I am really sorry for the ‘simple’ question, but I am quite new to KMM. I have one KMM App (like general utils library for both Android & iOS apps that I have) from Plugin in Android Studio. — How do I build both .jar & .framework to transfer them to my main project and where do they get saved? Thanks guys 🙂
k

Kris Wong

11/03/2020, 10:35 PM
are you familiar with gradle?
f

Fanis Paschos

11/03/2020, 10:39 PM
Hello @Kris Wong. Just a little bit. Shall I add code there?
As I can see, there is a packForXcode variable
k

Kris Wong

11/03/2020, 10:39 PM
run the assemble task. this will build all your targets.
f

Fanis Paschos

11/03/2020, 10:39 PM
Shall I place something similar there;
Ok, great
And where should I look for the output .jar file?
k

Kris Wong

11/03/2020, 10:40 PM
run
find build/ -name *.jar
f

Fanis Paschos

11/03/2020, 10:40 PM
I guess, that you are talking about this assemble, right?
k

Kris Wong

11/03/2020, 10:41 PM
yes
f

Fanis Paschos

11/03/2020, 10:41 PM
Sorry, but I am not really familiar
how do I run this command? and where?
i Am using a MacBook
k

Kris Wong

11/03/2020, 10:42 PM
you know how to use the terminal?
f

Fanis Paschos

11/03/2020, 10:43 PM
Just a little bit
k

Kris Wong

11/03/2020, 10:43 PM
you can run that command in your source root
though it may be better to replace 'build/' with '.' depending on your setup
f

Fanis Paschos

11/03/2020, 10:46 PM
it says ‘operation not permitted’
Well, I fixed that
now there are a lot of these files
which one should I look for? *thanks a lot for your help!
k

Kris Wong

11/03/2020, 10:55 PM
there should only be a couple
ah, I see there's probably some intermediates
f

Fanis Paschos

11/03/2020, 10:56 PM
yes, exactly
which one should I look for though?
k

Kris Wong

11/03/2020, 10:56 PM
it should be named the same as your project
probably under build/libs
f

Fanis Paschos

11/03/2020, 10:57 PM
are these the ones?
k

Kris Wong

11/03/2020, 10:58 PM
do you have an android target or a JVM target?
f

Fanis Paschos

11/03/2020, 11:00 PM
Sorry but, how do I check that?
k

Kris Wong

11/03/2020, 11:01 PM
in your build.gradle[.kts]
f

Fanis Paschos

11/03/2020, 11:02 PM
I think it is Android(if I found that correctly)
android has its own archive format - aar
f

Fanis Paschos

11/03/2020, 11:06 PM
Oh ok
So, shall I look for .aar?
and, how do I build into .aar?
k

Kris Wong

11/03/2020, 11:07 PM
yes
f

Fanis Paschos

11/03/2020, 11:07 PM
as I can see, under settings.gradle.kts there are these two lines of code
Copy code
include(":androidApp")
include(":shared")
How do I create the .aar file though?
k

Kris Wong

11/03/2020, 11:14 PM
the assemble task
f

Fanis Paschos

11/03/2020, 11:15 PM
ok. I just did it, but the file says that it has modified 5 days ago 😕
Shouldn’t it say seconds ago?
k

Kris Wong

11/03/2020, 11:17 PM
only if something has changed in the meantime
otherwise you can clean and run it again
f

Fanis Paschos

11/03/2020, 11:18 PM
Ok, I will try now!!
afterwards, I copy/paste the .aar file under /libs/ folder and then place in the gradle(app) the following line:
Copy code
implementation files('libs/myname.aar')
is that correct?
k

Kris Wong

11/03/2020, 11:20 PM
i don't recall if that's completely correct, but it's correct in principal at least
f

Fanis Paschos

11/03/2020, 11:21 PM
Ok ok, great
will figure out the rest
@Kris Wong I am really thankful!! Thank you for your time and effort to help me, due to the fact I am quite new to KMM 🙂
🍻 1
have a wonderful night!! till the next time!! cya! 🙂