在android中使用Twitter4j,在库中获取lint错误 – 库中无效的包引用

嗨,我正在使用twitter4j在 Android应用程序中使用twitter API.一切顺利,图书馆没有问题.今天我在twitter4j-core-3.0.3.jar中运行了lint并发现lint错误.
我没有控制这个第三方图书馆,所以应该做什么.

lint错误如下:
库中无效的包引用;不包括在Android中:javax.management.openmbean.从twitter4j.management.APIStatisticsOpenMBean引用.

Issue: Finds API accesses to APIs that are not supported in Android

Id: InvalidPackage

This check scans through libraries looking for calls to APIs that are not included in Android.

When you create Android projects,the classpath is set up such that you can only access classes in the API packages that are included in Android. However,if you add other projects to your libs/ folder,there is no guarantee that those .jar files were built with an Android specific classpath,and in particular,they Could be accessing unsupported APIs such as java.applet.

This check scans through library jars and looks for references to API packages that are not included in Android and flags these. This is only an error if your code calls one of the library classes which wind up referencing the unsupported package.

解决方法

如果从命令行运行Lint,您可以在项目目录中提供一个lint.xml,并使用以下配置忽略twitter4j jar文件.
<?xml version="1.0" encoding="UTF-8"?>
<lint>
    <issue id="InvalidPackage">
        <ignore path="libs/twitter4j-core-3.0.5.jar" />
    </issue>
</lint>

Lint的Comand线选项可以在http://developer.android.com/tools/help/lint.html找到

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...