1

I have an android project (call it myProj) and android library (call it myLib) Now inside the myLib I have a bunch of jar files that it rely on, and one of those jar that is inside myLib (libs folder) is needed for my android project myProj

How can I load / introduce that jar file to myProj??? no matter what I've done it can't see that jar - By that I mean that I can't add imports that are present inside that jar (and if I add it to myProj libs folder I get Error: Program type already present: (obviously)

I already tried creating third project with configurations.create("default") artifacts.add("default", file('somelib.jar'))https://stackoverflow.com/a/22415260/617373 but id didn't work at all...

and the following does not help either File ->Project Structure ->App-> dependencies -> + ->add library by adding a library you don't add its jars :(

Any Ideas are welcomed

Daniel
  • 36,833
  • 10
  • 119
  • 200
  • I literally just asked this exact question lol https://stackoverflow.com/q/54817725/5184092 – luckyging3r Feb 21 '19 at 23:19
  • 1
    @luckyging3r you just got your self a +1... :) that my exact problem! you might wanna try https://stackoverflow.com/a/22415260/617373 (didn't work for me...) I hope well get an answer... – Daniel Feb 21 '19 at 23:41
  • 1
    @luckyging3r what are the odds for that double post / exact problem :) – Daniel Feb 21 '19 at 23:45

1 Answers1

2

If this doesn't work:

File ->Project Structure -> App-> dependencies -> + ->add library

In your myProj build.gradle file add:

dependencies {
    implementation files('../myLib/libs/somelib.jar')
}

sync project with gradle files and then make project

luckyging3r
  • 3,047
  • 3
  • 18
  • 37