错误:无法解决:com.itextpdf:itextpdf:4.2.2 [英] Error:Failed to resolve: com.itextpdf:itextpdf:4.2.2
问题描述
我正在尝试使用itext库在android中创建pdf文件.但是,每当我运行该项目时,都会出现以下错误.
I am trying to create pdf files in android using itext library. But whenever i run the project, I am getting the following error.
Error:Failed to resolve: com.itextpdf:itextpdf:4.2.2
我在gradle中输入了以下依赖项.
I have entered the following dependencies in my gradle.
compile 'com.lowagie:itext:4.2.2'
compile 'com.itextpdf:itextg:5.5.9'
有人可以帮忙吗?我在互联网上进行了很多搜索,但一无所获.
Can someone please help in this. I have searched a lot on internet but have found nothing.
推荐答案
当您要创建Android应用程序时,需要使用iTextG,所以这是正确的:
When you want to create an Android application, you need to use iTextG, so this is correct:
compile 'com.itextpdf:itextg:5.5.9'
但是,您还将导入在Android上无法正常运行的iText流氓版本:
However, you are also importing a rogue version of iText that doesn't work on Android:
compile 'com.lowagie:itext:4.2.2'
您需要删除该依赖项.
请比较包裹名称和我的名字: Lowagie .我是iText的原始开发人员,由于有如此多的人亲自联系(甚至骚扰我)有关iText的问题,因此我在2009年将软件包名称从com.lowagie
更改为com.itextpdf
.将近8年了以前.
Please compare the package name with my name: Lowagie. I am the original developer of iText, and because of the fact that so many people contacted (or even harassed me) personally with questions about iText, I changed the package names from com.lowagie
to com.itextpdf
in 2009. That's almost 8 years ago.
如果您在代码中看到我的名字,则您做错了什么.用import com.itextpdf
替换所有import com.lowagie
实例,因为8年前我从打包名称中删除了我的名字.
If you see my name in your code, then you are doing something wrong. Replace all import com.lowagie
instances with import com.itextpdf
because I removed my name from the packaged names 8 years ago.
这篇关于错误:无法解决:com.itextpdf:itextpdf:4.2.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!