Skip to content

添加action之后报错 Multiple dex files define Lcom/provider/ProviderInit; #1

@huhanghao

Description

@huhanghao

2017.4.14 10:00
**FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:transformClassesWithDexForDebug'.

com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/provider/ProviderInit;

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.**

我在libmodule里面添加action之后运行的时候报的错。
感觉是provider重名了,但是检查了provider发现没有重名,更改provider注册的名字之后还是没有解决。
我的@action 为processName=主工程的包名, providerName = “share”
我的@Provider为processName=主工程的包名
求助下

2017.4.14 11:30
经过排查,发现我的项目只要同时有两个action就会报这个错。感觉是不是module配置的有问题

2017.4.14 15:00
同事pull了项目,运行之后正常。我觉得好奇怪,在同事的机器上正常,我的机器报错~

2017.4.14 15:30
查看IDE和gradle相关版本:
java版本:java version "1.8.0_111"
gradle中配置:compileSdkVersion 25
                         buildToolsVersion "25.0.0"
                         gradle版本:2.3.0
AS版本:2.2.3
同事的和我的差不多~~感觉是我的IDE的问题吧?~等我再查查

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions