我认为这可能是一个愚蠢的问题,但我正在尝试在我的应用程序中使用 jar 文件,但找不到如何导入它。我已成功将 jar 添加到我的库中:
我现在只需要通过代码来使用它。是否有一个应该随文件一起提供的 import
语句?因为我似乎找不到它
最佳答案
Is there an import statement that should have come with the file?
在 Java 代码中?是的。例如:where you copied the code from
I'm trying to use a jar file within my app
打开build.gradle
,在dependencies
block 中寻找compile fileTree
行
如果该行显示为“获取 libs/
目录中的所有 JAR 文件”,则您无需执行任何操作。
理想情况下,不过,您不需要 JAR 文件。
dependencies {
...
// Add this line
compile group: 'edu.emory.mathcs', name: 'JTransforms', version: '2.4'
}
关于android - 在应用程序中使用导入的 JAR 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43397088/