• weibo sdk Multiple dex files define Lcom/sina/weibo/sdk/BuildConfig


      集成新浪微博SDK,用gradle编译时,报如下错误:

    UNEXPECTED TOP-LEVEL EXCEPTION:
    com.android.dex.DexException: Multiple dex files define Lcom/sina/weibo/sdk/BuildConfig;
    at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:594)
    at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:552)
    at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:533)
    at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:170)
    at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
    at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287)
    at com.android.dx.command.dexer.Main.run(Main.java:230)
    at com.android.dx.command.dexer.Main.main(Main.java:199)
    at com.android.dx.command.Main.main(Main.java:103)
    

      原因是weibosdkcore.jar里面的BuildConfig.class,本来这个文件不应该存在于jar里,不知微博的开发怎么搞进去的。
    解决方法很简单:解包weibosdkcore.jar,删除里面的 BuildConfig.class,然后重新打包 jar。

      


    具体如下:
      1. 解压jar包:
          jar xf weibosdkcore.jar
      2. 删除解压后目录里面的com/sina/weibo/sdk/BuildConfig.class
      3. 重新打包:
          jar cvf weibosdkcore.jar *

  • 相关阅读:
    [NOI2017]游戏
    [USACO09MAR]Cleaning Up
    [POI2010]Blocks
    [JSOI2011]分特产
    [POI2001]Peaceful Commission
    BZOJ4152 [AMPPZ2014]The Captain
    Luogu P3783 [SDOI2017]天才黑客
    Luogu P3645 [APIO2015]雅加达的摩天楼
    Luogu P1613 跑路
    AGC009E Eternal Average
  • 原文地址:https://www.cnblogs.com/louguanyang/p/4567397.html
Copyright © 2020-2023  润新知