2 yanping0912 yanping0912 于 2017.01.04 13:52 提问

添加了友盟和百度地图 打包报错了 各位大神帮帮忙 小女子先谢谢了!

不打包运行的时候 报错是:

 com.umeng.common.message.c 
 com.driver.sy.app_passenger.R$array
 - App_passenger] Proguard returned with error code 1. See console
[2017-01-04 12:43:21 - App_passenger] Note: there were 362 duplicate class definitions.
[2017-01-04 12:43:21 - App_passenger] Warning: com.baidu.mapapi.map.WearMapView: can't find superclass or interface android.view.View$OnApplyWindowInsetsListener
[2017-01-04 12:43:21 - App_passenger] Warning: library class org.apache.http.conn.scheme.LayeredSocketFactory extends or implements program class org.apache.http.conn.scheme.SocketFactory
[2017-01-04 12:43:21 - App_passenger] Warning: com.baidu.mapapi.map.WearMapView: can't find referenced class android.view.View$OnApplyWindowInsetsListener
[2017-01-04 12:43:21 - App_passenger] Warning: com.baidu.mapapi.map.WearMapView: can't find referenced class android.view.WindowInsets
[2017-01-04 12:43:21 - App_passenger] Warning: com.baidu.mapapi.map.WearMapView: can't find referenced class android.view.WindowInsets
[2017-01-04 12:43:21 - App_passenger] Warning: com.baidu.mapapi.map.WearMapView: can't find referenced method 'void setOnApplyWindowInsetsListener(android.view.View$OnApplyWindowInsetsListener)' in class com.baidu.mapapi.map.WearMapView
[2017-01-04 12:43:21 - App_passenger] Warning: com.baidu.mapapi.map.WearMapView: can't find referenced class android.view.WindowInsets
[2017-01-04 12:43:21 - App_passenger] Warning: com.baidu.mapapi.map.WearMapView: can't find referenced class android.view.WindowInsets
[2017-01-04 12:43:21 - App_passenger] Warning: com.baidu.platform.comapi.NativeLoader: can't find referenced field 'java.lang.String[] SUPPORTED_ABIS' in class android.os.Build
[2017-01-04 12:43:21 - App_passenger] Warning: library class android.webkit.WebView depends on program class android.net.http.SslCertificate
[2017-01-04 12:43:21 - App_passenger] Warning: library class android.webkit.WebView depends on program class android.net.http.SslCertificate
[2017-01-04 12:43:21 - App_passenger] Warning: library class android.webkit.WebViewClient depends on program class android.net.http.SslError
[2017-01-04 12:43:21 - App_passenger] Warning: library class org.apache.http.conn.ssl.SSLSocketFactory depends on program class org.apache.http.conn.scheme.HostNameResolver
[2017-01-04 12:43:21 - App_passenger] Warning: library class org.apache.http.conn.ssl.SSLSocketFactory depends on program class org.apache.http.params.HttpParams
[2017-01-04 12:43:21 - App_passenger] Warning: library class org.apache.http.params.HttpConnectionParams depends on program class org.apache.http.params.HttpParams
[2017-01-04 12:43:21 - App_passenger] Warning: library class org.apache.http.params.HttpConnectionParams depends on program class org.apache.http.params.HttpParams
[2017-01-04 12:43:21 - App_passenger] Warning: library class org.apache.http.params.HttpConnectionParams depends on program class org.apache.http.params.HttpParams
[2017-01-04 12:43:21 - App_passenger] Warning: library class org.apache.http.params.HttpConnectionParams depends on program class org.apache.http.params.HttpParams
[2017-01-04 12:43:21 - App_passenger] Warning: library class org.apache.http.params.HttpConnectionParams depends on program class org.apache.http.params.HttpParams
[2017-01-04 12:43:21 - App_passenger] Warning: library class org.apache.http.params.HttpConnectionParams depends on program class org.apache.http.params.HttpParams
[2017-01-04 12:43:21 - App_passenger] Warning: library class org.apache.http.params.HttpConnectionParams depends on program class org.apache.http.params.HttpParams
[2017-01-04 12:43:21 - App_passenger] Warning: library class org.apache.http.params.HttpConnectionParams depends on program class org.apache.http.params.HttpParams
[2017-01-04 12:43:21 - App_passenger] Warning: library class org.apache.http.params.HttpConnectionParams depends on program class org.apache.http.params.HttpParams
[2017-01-04 12:43:21 - App_passenger] Warning: library class org.apache.http.params.HttpConnectionParams depends on program class org.apache.http.params.HttpParams
[2017-01-04 12:43:21 - App_passenger] Warning: library class org.apache.http.params.HttpConnectionParams depends on program class org.apache.http.params.HttpParams
[2017-01-04 12:43:21 - App_passenger] Warning: library class org.apache.http.params.HttpConnectionParams depends on program class org.apache.http.params.HttpParams
[2017-01-04 12:43:21 - App_passenger]       You should check if you need to specify additional program jars.
[2017-01-04 12:43:21 - App_passenger] Warning: there were 6 unresolved references to classes or interfaces.
[2017-01-04 12:43:21 - App_passenger]          You may need to specify additional library jars (using '-libraryjars').
[2017-01-04 12:43:21 - App_passenger] Warning: there were 18 instances of library classes depending on program classes.
[2017-01-04 12:43:21 - App_passenger]          You must avoid such dependencies, since the program classes will
[2017-01-04 12:43:21 - App_passenger]          be processed, while the library classes will remain unchanged.
[2017-01-04 12:43:21 - App_passenger] Warning: there were 2 unresolved references to program class members.
[2017-01-04 12:43:21 - App_passenger]          Your input classes appear to be inconsistent.
[2017-01-04 12:43:21 - App_passenger]          You may need to recompile them and try again.
[2017-01-04 12:43:21 - App_passenger]          Alternatively, you may have to specify the option 
[2017-01-04 12:43:21 - App_passenger]          '-dontskipnonpubliclibraryclassmembers'.
[2017-01-04 12:43:21 - App_passenger] Error: Please correct the above warnings first.

proguard-rules.txt内容如下:

 # To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}

-dontwarn com.ut.mini.**
-dontwarn okio.**
-dontwarn com.xiaomi.**
-dontwarn com.squareup.wire.**
-dontwarn android.support.v4.**

-keepattributes *Annotation*

-keep class android.support.v4.** { *; }
-keep interface android.support.v4.app.** { *; }

-keep class okio.** {*;}
-keep class com.squareup.wire.** {*;}

-keep class com.umeng.message.protobuffer.* {
        public <fields>;
        public <methods>;
}
-keep class com.umeng.message.* {
    public <fields>;
    public <methods>;
}

-keep class org.android.agoo.impl.*{
    public <fields>;
    public <methods>;
}

-keep class org.android.agoo.service.* {*;}

-keep class org.android.spdy.**{*;}

-keep public class com.umeng.message.example.R$*{
   public static final int *;
}

![![![图片说明](http://img.ask.csdn.net/upload/201701/04/1483509101_972911.png)图片说明](http://img.ask.csdn.net/upload/201701/04/1483509091_99643.png)图片说明](http://img.ask.csdn.net/upload/201701/04/1483509080_828721.png)图片说明

4个回答

xzz_6767
xzz_6767   2017.01.04 17:17
已采纳

加入百度的混淆配置,百度地图官网http://lbsyun.baidu.com/index.php?title=androidsdk/guide/buildproject有
配置如下:
-keep class com.baidu.** {*;}
-keep class vi.com.** {*;}

-dontwarn com.baidu.**

xzz_6767
xzz_6767 回复yanping0912: 把每个jar包对应的混淆配置加上,一般官网就有介绍怎么混淆
11 个月之前 回复
yanping0912
yanping0912 加了你说的这个百度配置 打包结果如下:
11 个月之前 回复
yanping0912
yanping0912   2017.01.04 13:50

图片说明

yanping0912
yanping0912   2017.01.04 13:51

图片说明图片说明

yanping0912
yanping0912   2017.01.05 21:16

[2017-01-05 21:08:19 - App_passenger] Proguard returned with error code 1. See console
[2017-01-05 21:08:19 - App_passenger] Note: there were 362 duplicate class definitions.
[2017-01-05 21:08:19 - App_passenger] Warning: library class org.apache.http.conn.scheme.LayeredSocketFactory extends or implements program class org.apache.http.conn.scheme.SocketFactory
[2017-01-05 21:08:19 - App_passenger] Warning: library class android.webkit.WebView depends on program class android.net.http.SslCertificate
[2017-01-05 21:08:19 - App_passenger] Warning: library class android.webkit.WebView depends on program class android.net.http.SslCertificate
[2017-01-05 21:08:19 - App_passenger] Warning: library class android.webkit.WebViewClient depends on program class android.net.http.SslError
[2017-01-05 21:08:19 - App_passenger] Warning: library class org.apache.http.conn.ssl.SSLSocketFactory depends on program class org.apache.http.conn.scheme.HostNameResolver
[2017-01-05 21:08:19 - App_passenger] Warning: library class org.apache.http.conn.ssl.SSLSocketFactory depends on program class org.apache.http.params.HttpParams
[2017-01-05 21:08:19 - App_passenger] Warning: library class org.apache.http.params.HttpConnectionParams depends on program class org.apache.http.params.HttpParams
[2017-01-05 21:08:19 - App_passenger] Warning: library class org.apache.http.params.HttpConnectionParams depends on program class org.apache.http.params.HttpParams
[2017-01-05 21:08:19 - App_passenger] Warning: library class org.apache.http.params.HttpConnectionParams depends on program class org.apache.http.params.HttpParams
[2017-01-05 21:08:19 - App_passenger] Warning: library class org.apache.http.params.HttpConnectionParams depends on program class org.apache.http.params.HttpParams
[2017-01-05 21:08:19 - App_passenger] Warning: library class org.apache.http.params.HttpConnectionParams depends on program class org.apache.http.params.HttpParams
[2017-01-05 21:08:19 - App_passenger] Warning: library class org.apache.http.params.HttpConnectionParams depends on program class org.apache.http.params.HttpParams
[2017-01-05 21:08:19 - App_passenger] Warning: library class org.apache.http.params.HttpConnectionParams depends on program class org.apache.http.params.HttpParams
[2017-01-05 21:08:19 - App_passenger] Warning: library class org.apache.http.params.HttpConnectionParams depends on program class org.apache.http.params.HttpParams
[2017-01-05 21:08:19 - App_passenger] Warning: library class org.apache.http.params.HttpConnectionParams depends on program class org.apache.http.params.HttpParams
[2017-01-05 21:08:19 - App_passenger] Warning: library class org.apache.http.params.HttpConnectionParams depends on program class org.apache.http.params.HttpParams
[2017-01-05 21:08:19 - App_passenger] Warning: library class org.apache.http.params.HttpConnectionParams depends on program class org.apache.http.params.HttpParams
[2017-01-05 21:08:19 - App_passenger] Warning: library class org.apache.http.params.HttpConnectionParams depends on program class org.apache.http.params.HttpParams
[2017-01-05 21:08:19 - App_passenger]       You should check if you need to specify additional program jars.
[2017-01-05 21:08:19 - App_passenger] Warning: there were 18 instances of library classes depending on program classes.
[2017-01-05 21:08:19 - App_passenger]          You must avoid such dependencies, since the program classes will
[2017-01-05 21:08:19 - App_passenger]          be processed, while the library classes will remain unchanged.
[2017-01-05 21:08:19 - App_passenger] Error: Please correct the above warnings first.

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!