目前我正在尝试为我现有的 Android 应用程序设置一个 Maven 构建。(以前是用 Ant 构建的)在运行 proguard 混淆时,我收到很多警告,告诉我以下内容:
...
can't find referenced class org.apache.http.params.BasicHttpParams
can't find referenced class org.apache.http.params.BasicHttpParams
can't find referenced class org.apache.http.params.HttpConnectionParams
can't find referenced class org.apache.http.params.HttpConnectionParams
can't find referenced class org.apache.http.impl.client.DefaultHttpClient
can't find referenced class org.apache.http.impl.client.DefaultHttpClient
can't find referenced class org.apache.http.impl.client.DefaultHttpClient
can't find referenced class org.apache.http.auth.AuthScope
can't find referenced class org.apache.http.auth.AuthScope
can't find referenced class org.apache.http.auth.UsernamePasswordCredentials
...
缺少的参考来自org.apache.http包。我认为它们应该包含在 android.jar 中。我正在使用android-maven-plugin版本3.2.0。在 pom.xml 中定义了以下 android 依赖项。
<dependency>
<groupId>android</groupId>
<artifactId>android</artifactId>
<version>4.0.3_r3</version>
<scope>provided</scope>
</dependency>
我已经使用maven-android-sdk-deployer安装了 Android 依赖项。
这种错误的正确解决方案是什么?没有混淆,构建成功,生成的 APK 运行良好。我没有更改 proguard 配置文件。(它与蚂蚁结合使用)