sebhaub
sebhaub

Reputation: 734

android lint - InvalidPackage errors when using apache odata-client-android

I want to use the apache olingo odata library in an android project. Since apache offers a specific build for android, i put this one as a dependency to my build.gradle file.

compile 'org.apache.olingo:odata-client-android:4.0.0'

When building the application, i run into multiple InvalidPackage lint errors:

As an example:

InvalidPackage: Package not included in Android
 odata-client-android-4.0.0.jar: Invalid package reference in library; 
 not included in Android: javax.activation. Referenced from
 com.fasterxml.jackson.module.jaxb.deser.DataHandlerJsonDeserializer.

There are also InvalidPackage errors for the javax.xml.bind package

As a Solution, it is suggested to add the following rule to build.gradle:

android {
    lintOptions {
        abortOnError false
    }
}

So my questions are :

Thanks in advance for any help

Upvotes: 4

Views: 2286

Answers (1)

Nagesh Susarla
Nagesh Susarla

Reputation: 1700

The InvalidPackage lint check flags packages that are not included by default on Android. If you're certain that the javax.activation package is not used on Android either because they provide a separate code path for using it, you can disable the check.

lintOptions {
  disable 'InvalidPackage',...
}

To get more information about the actual error you can use lint --show InvalidPackage

Upvotes: 2

Related Questions