android – 错误:任务执行失败’:app:transformClassesWithDexBuilderForDebug’

当我添加ONE SHARE SDK作为依赖项时,我收到以下错误消息:

Error:Execution failed for task ‘:app:transformClassesWithDexBuilderForDebug’.
com.android.build.api.transform.TransformException: org.gradle.tooling.BuildException:
com.android.dx.cf.iface.ParseException: class name (com/sina/weibo/sdk/component/view/CommentComponentView$RequestParam)
does not match path (weiboSDKCore_3.1.2/com/sina/weibo/sdk/component/view/CommentComponentView$RequestParam.class)

可能是导致此错误的原因是什么?

最佳答案 将以下代码添加到
build.gradle app模块解决了我的问题

android{
    defaultConfig {

        // Enabling multidex support.
        multiDexEnabled true
    }


    dexOptions {
        javaMaxHeapSize "4g"
    }
}
dependencies {
    //...
    compile 'com.android.support:multidex:1.0.0'
}

Source Code

点赞