android打包问题

ProGuard, version 6.0.3

Warning: Exception while processing task java.io.IOException: The same input jar [/Users/xl/Documents/Code/Xianglin/NewProject/XLWallet/app/libs/libammsdk.jar] is specified twice.

> Task :app:transformClassesAndResourcesWithProguardForRelease FAILED
Request to incrementing alive workforce from 0. Current workforce (dead or alive) 0
 

解决方法如下:
打开 proguard-rules.pro

-libraryjars libs/libammsdk.jar

在所有的-libraryjars 前插入 # 成 #-libraryjars xxxx.jar

原因分析
原因是build.gradle文件配置了

dependencies {
    compile fileTree(include: '*.jar', dir: 'libs')
}
里面已经添加过jar包,混淆文件proguard.cfg里面又加了句-libraryjars libs/***.jar,将-libraryjars libs/***.jar 前面用#号注释或者直接删掉即可。

运行应用的时候,在低版本的应用上5.0以下报错:

    java.lang.RuntimeException: Unable to get provider android.support.v4.content.FileProvider: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.content.FileProvider" on path: DexPathList[[zip file "/data/app/com.li.mvpprogram-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.li.mvpprogram-2, /vendor/lib, /system/lib]]
 

那么这个问题该怎么处理呢?思考一下,版本问题。。。minSdkVersion17是支持多少,或者说就是这个引起的。那么到官网去看看。为什么?

扫描二维码关注公众号,回复: 8640628 查看本文章

  

  

那么从图中我们可以看到这个问题

https://developer.android.com/studio/build/multidex.html#mdex-gradle

是不是在大于20或者小于20.。。。然后我正是17,然后遇到了4.4.4的版本

这酸爽了~~~

改改~~那么怎么改呢。按上面google说的加入compile 'com.android.support:multidex:1.0.2'

但是加完之后执行~~~请看完!!!!!

下面还有一段话 在我们的初始化文件执行这一段

public class MyApplication extends SomeOtherApplication {
  @Override
  protected void attachBaseContext(Context base) {
     super.attachBaseContext(context);
     Multidex.install(this);
  }
}
 

发布了74 篇原创文章 · 获赞 36 · 访问量 25万+

猜你喜欢

转载自blog.csdn.net/kdsde/article/details/84791634