Hello, I think I understand how to add external libaries reading this article.
I am trying to add androidx libraries, I believe it is what I need to create a background service using WorkManager. Anyway my issue is I cannot seem to find .jar/aar library files for that package! Everything I read online tells me that I must use maven/build.gradle.
Maybe this library is incompatible? Cant we target API29? I seem to be able to find other libraries .jar/.aar files easily?
Hello please give me some guidance as to what the heck I just did.
I downloaded the .aar file (since I read it includes a .jar file) and I used a decompressor to just extract all the .jar files (in this case classes.jar, inspector.jar, and init.jar). I then imported those 3 files as java libraries and it appears it is all working (I can import androidx.work.WorkManager). Is this a fine approach?
(The three files I took)
I havnt tested running code yet because I dont have any, but I feel like it wont work, I think i need that res folder, and not inspector.jar or init.jar
Which is why Im trying to do it manually, cant figure out how to find maven "coordinates" or whatnot for said package.
EDIT:I got a message back from a developer of my IDE and was told that I should use maven, or my workaround will be tedious and that my problem is I need to set up my project specifically as a maven project so that I can add/change where maven searches for repositories. In my case add https://maven.google.com. I will try that tonight and report back, hopefully the info isnt just helpful to my IDE.
EDIT2: I think I may be complicating things to much since now I need to set up maven with ant... but i still cant figure out how to get the package i want imported into my project unless my workaround is fine.. going to hope that works
1 - Download the aar file
2 - Extract the classes.jar from that
3 - Paste in a subdirectory in lib folder
4 - Add the entry to component/build.xml
5 - In extension use @UsesLibraries annotation
Extensions are also components i.e. external components.
But the documents does not say anything about extension template so it is understable that aar is only effective when you compile extension using the source.
And if it does then you will have to do same for aar also i.e.
3 - Paste in a subdirectory in lib folder
4 - Add the entry to component/build.xml
5 - In extension use @UsesLibraries annotation
I thought I had to do this regardless
Excuse my noobness, but can you elaborate? How would I check? And if it does would I copy the /res folder from the .aar file also (to a subdirectory in /lib in my project)?
Currently I'm just importing the classes.jar file from the .aar as I do not understand.
Thanks
Maybe I should just apply @jarlissonlira2's patch and use the .aar?
Even if you build the extension using @Jarlissonlira2 's patch, aar will not work, the distributions where you want to use the extension should use the patch as well. Extraction of jar from aar file is the only way as of now