How to add commons-math library in Android Studio
Asked Answered
S

2

5

I am trying to import common-math library to my Android Studio project. I placed the file commons-math3-3.6.1.jar file in libs folder and in the gradle file I have this line:

compile 'commons-math3-3.6.1.jar'

But I get this error: `

Error:(32, 0) Supplied String module notation 'commons-math3-3.6.1.jar' is invalid. Example notations: 'org.gradle:gradle-core:2.2', 'org.mockito:mockito-core:1.9.5:javadoc'.

Can anyone tell me what I have to do?

Store answered 18/6, 2016 at 0:57 Comment(0)
A
9

Is there a reason you need to use the jar file? You can get the file directly from Maven repository using something like this:

compile 'org.apache.commons:commons-math3:3.6.1'

Available on both JCenter and MavenCentral.

Afrikaner answered 18/6, 2016 at 1:37 Comment(0)
M
8

in Android view open Gradle Scripts - build.gradle and add this to dependencies:

implementation 'org.apache.commons:commons-math3:3.6.1'

You can also check their websites if newer version isn't available list of latest versions

Meehan answered 29/5, 2019 at 11:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.