国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

安卓打包混淆報錯:can't find superclass or interface各種警告找不到

2019-11-09 18:26:46
字體:
來源:轉載
供稿:網友

警告內容如下示例:

[2014-01-06 08:58:44 - emp_android] Warning: com.baidu.location.b: can't find referenced method 'boolean addNmeaListener(android.location.GpsStatus$NmeaListener)' in class android.location.LocationManager[2014-01-06 08:58:44 - emp_android] Warning: com.baidu.location.b: can't find referenced method 'void removeNmeaListener(android.location.GpsStatus$NmeaListener)' in class android.location.LocationManager[2014-01-06 08:58:44 - emp_android] Warning: com.baidu.location.b: can't find referenced class android.location.GpsStatus$NmeaListener[2014-01-06 08:58:44 - emp_android] Warning: com.baidu.location.b$a: can't find referenced class android.location.GpsStatus$NmeaListener[2014-01-06 08:58:44 - emp_android] Warning: com.baidu.location.c: can't find referenced class android.telephony.cdma.CdmaCellLocation[2014-01-06 08:58:44 - emp_android] Warning: com.baidu.location.c$a: can't find referenced method 'int getLac()' in class android.telephony.NeighboringCellInfo[2014-01-06 08:58:44 - emp_android] Warning: com.baidu.location.c$b: can't find referenced class android.telephony.SignalStrength[2014-01-06 08:58:44 - emp_android] Warning: com.baidu.location.c$b: can't find referenced class android.telephony.SignalStrength[2014-01-06 08:58:44 - emp_android] Warning: com.baidu.location.c$b: can't find referenced class android.telephony.SignalStrength[2014-01-06 08:58:44 - emp_android] Warning: com.baidu.location.c$b: can't find referenced class android.telephony.SignalStrength[2014-01-06 08:58:44 - emp_android] Warning: com.lakala.b.b$2: can't find referenced method 'boolean isWiredHeadsetOn()' in class android.media.AudioManager[2014-01-06 08:58:44 - emp_android] Warning: com.lingtu.mapapi.MapView: can't find referenced method 'int getPointerCount()' in class android.view.MotionEvent[2014-01-06 08:58:44 - emp_android] You should check if you need to specify additional PRogram jars.[2014-01-06 08:58:44 - emp_android] Warning: there were 20 unresolved references to classes or interfaces.[2014-01-06 08:58:44 - emp_android] You may need to specify additional library jars (using '-libraryjars').[2014-01-06 08:58:44 - emp_android] Warning: there were 8 unresolved references to program class members.[2014-01-06 08:58:44 - emp_android] Your input classes appear to be inconsistent.[2014-01-06 08:58:44 - emp_android] You may need to recompile them and try again.[2014-01-06 08:58:44 - emp_android] Alternatively, you may have to specify the option [2014-01-06 08:58:44 - emp_android] '-dontskjava.io.IOException: Please correct the above warnings first.[2014-01-06 08:58:44 - emp_android]at proguard.Initializer.execute(Initializer.java:321)[2014-01-06 08:58:44 - emp_android]at proguard.ProGuard.initialize(ProGuard.java:211)[2014-01-06 08:58:44 - emp_android]at proguard.ProGuard.execute(ProGuard.java:86)[2014-01-06 08:58:44 - emp_android]at proguard.ProGuard.main(ProGuard.java:492)

**大體意思是找不到相關的類或者方法,因為工程引入了第三方包,混淆的時候如果把第三方包也混淆了,那么相關的類在使用這些包的時候就會找不到相關方法。 因此在proguard.cfg加上以下代碼:**

-dontwarn com.baidu.** -keep class com.baidu.** { *;} -dontwarn com.lakala.** -keep class com.lakala.** { *;} -dontwarn com.lingtu.** -keep class com.lingtu.** { *;} -dontwarn com.xx.bbb.**-keep class com.xx.bbb.** { *;}

參數來保持第三方庫中的類而不亂,-dontwarn和-keep 結合使用,意思是保持com.xx.bbb.這個包里面的所有類和所有方法而不混淆,接著還叫ProGuard不要警告找不到com.xx.bbb.這個包里面的類的相關引用。 配置好后,配置混淆打開,

buildTypes { release { signingConfig signingConfigs.release //打印的開關,關閉 buildConfigField "boolean", "LOG_DEBUG", "false" minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } debug {

重新打包,就可以打包成功了。

–>路要一步一步走,記住自己走過的路,不再犯同樣的錯誤,才是真正的成長!歡迎指點、交流。<–


上一篇:Handler系列(一)之ThreadLocal

下一篇:11

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 遵义市| 海城市| 白玉县| 顺义区| 阆中市| 嘉定区| 恭城| 马山县| 安多县| 象州县| 福泉市| 陕西省| 吐鲁番市| 正安县| 高安市| 安徽省| 东丽区| 永安市| 莫力| 汕尾市| 合肥市| 黎川县| 弋阳县| 大埔县| 华蓥市| 门头沟区| 娄烦县| 阿城市| 新巴尔虎左旗| 白山市| 桂东县| 广饶县| 英吉沙县| 福贡县| 且末县| 寿光市| 枞阳县| 桃园县| 焉耆| 静宁县| 临武县|