添加gradle依赖项后无法使用apache.poi库 [英] Unable to use the apache.poi library after adding gradle dependency
本文介绍了添加gradle依赖项后无法使用apache.poi库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直试图使用apache.poi库来创建一个excel文件,但是由于某种原因,我无法导入任何内容.
I've been trying to use the apache.poi library to create an excel file but, for some reason, I'm unable to import anything.
mainClassName = 'Main'
sourceCompatibility = 1.7
targetCompatibility = 1.7
version = '1.0'
repositories {
mavenCentral()
}
dependencies {
compile 'com.google.api-client:google-api-client:1.22.0'
compile 'com.google.oauth-client:google-oauth-client-jetty:1.22.0'
compile 'com.google.apis:google-api-services-sheets:v4-rev21-1.22.0'
compile 'org.apache.poi:poi:3.9'
}
当我尝试编写import org.apache.poi时;它给我一个错误,说包装不存在". 我的依存关系有什么问题?谢谢.
When I am trying to write import org.apache.poi; it gives me an error saying "Package does not exist". What is wrong with my dependencies? Thanks.
推荐答案
有时,重新加载gradle项目很有用,因此gradle可以下载新依赖项的二进制文件.之后,新软件包应该可用.
Some times it is useful to reload a gradle project so gradle could download the binary of the new dependency. After that the new packages should be available.
这篇关于添加gradle依赖项后无法使用apache.poi库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文