1

I add itext for android library for android to my project, everything works but when I build my project using gradle lint generate this error:

InvalidPackage: Package not included in Android
../../libs/itextg-5.5.3.jar: Invalid package reference in library; not included in Android: java.awt. Referenced from com.itextpdf.text.pdf.BarcodeCodabar.
../../libs/itextg-5.5.3.jar: Invalid package reference in library; not included in Android: java.awt.image. Referenced from com.itextpdf.text.pdf.BarcodeCodabar.
../../libs/itextg-5.5.3.jar: Invalid package reference in library; not included in Android: javax.management. Referenced from com.itextpdf.testutils.ITextTest.
../../libs/itextg-5.5.3.jar: Invalid package reference in library; not included in Android: javax.xml.crypto.dom. Referenced from com.itextpdf.text.pdf.security.MakeXmlSignature.
../../libs/itextg-5.5.3.jar: Invalid package reference in library; not included in Android: javax.xml.crypto.dsig. Referenced from com.itextpdf.text.pdf.security.MakeXmlSignature.

Is it secure to suppress and ignore this error ?

I downloaded the latest android itext versione (5.5.3)

Thanks

Panciz
  • 2,183
  • 2
  • 30
  • 54
  • have you used android studio ? check : http://stackoverflow.com/questions/21827004/gradle-dagger-lint-ignore-by-package – Haresh Chhelana Nov 28 '14 at 13:49
  • I'm not aware of any free iText library for Android. However, there is a commercial iText library for Android, you can find some info [here](http://itextpdf.com/pricing/android_license). Unfortunately, if you decide to go with it, it will set you back [quite] a few bucks. –  Nov 28 '14 at 14:06

3 Answers3

5

Those dependencies were accidentally left in the android port of 5.5.3.

They will be removed for the upcoming 5.5.4 (release is in two weeks).

Michaël Demey
  • 1,567
  • 10
  • 18
  • I tried the new release but I still get the same error:Explanation: Finds API accesses to APIs that are not supported in Android. – Panciz Dec 22 '14 at 09:53
0

It will depend upon whether you need any of those classes, directly or indirectly. Using BarcodeCodabar, ITextTest, or MakeXmlSignature will likely result in a VerifyError at runtime, when those classes try using Java SE classes that do not exist in Android.

You might consider seeing if there is an Android-specific distribution of this library.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
0

You might consider seeing if there is an Android-specific distribution of this library.

Actually I use the Android version of the library, this means that they simply do not remove the reference even if these classes are not actually used? My app perfectly works !

@HareshChhelana

Thansks I use the gradle Lint option to suppress the worning

Panciz
  • 2,183
  • 2
  • 30
  • 54