alibaba / atlas

A powerful Android Dynamic Component Framework.
Apache License 2.0
8.13k stars 1.47k forks source link

[use]:升级到最新的版本 打release包,proguard后的包library的类找不到 #346

Open wtttc opened 5 years ago

wtttc commented 5 years ago

原来使用的

升级到

proguard-rules.pro保持和原来一样,只在app工程中添加了,没有使用consumerProguardFiles

出现错误如下,公共的sdk,打在maindex里的类,插件atlas工程都find不到

.....
Warning:there were 10840 unresolved references to classes or interfaces.
Warning:there were 834 unresolved references to program class members.
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> Job failed, see logs for details

麻烦请问升级atlasplugin:3.0.1-rc81后proguard有什么特殊需要修改的吗,demo工程我这release跑不起来

fengyerq commented 5 years ago

apply plugin: 'com.android.library' 替换为 apply plugin: 'com.taobao.atlas.library' 试试,我这情况跟你类似。也是引用不了,替换好之后,传递引用又出问题,你看看有没有?

wtttc commented 5 years ago

依旧不行

hwjump commented 5 years ago

有一处修改,bundle中的proguard文件不再生效了。 需要将所有的proguard文件,全部集中到打包壳工程里。 你可以这样试下

wtttc commented 5 years ago

一直使用的是app宿主工程中的proguard文件 “proguard-rules.pro“

 buildTypes {
        release {
            minifyEnabled true
            zipAlignEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            minifyEnabled false
            debuggable true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

这个和我公共的library开了multiDex有关系吗,

multiDexEnabled true
 multiDexKeepProguard file('multiDexKeep.pro') // keep specific classes using proguard syntax
//        multiDexKeepFile file('multiDexKeep.txt') // keep specific class

multiDexKeep.pro当前只放了bugly要求的东西

-keep public class com.tencent.bugly.**{*;}
ouzhangyu commented 4 years ago

一样的问题,升级后debug报正常,release会报类冲突Execution failed for task ':app:transformClassesWithJarMergingForRelease'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry

ouzhangyu commented 4 years ago

@wtttc 有解决release编译错误的问题了吗