How to put specific classes into main DEX file?

前端 未结 4 793
隐瞒了意图╮
隐瞒了意图╮ 2021-02-02 17:50

We found an issue on Amazon market that IAP doesn\'t work if it\'s receivers located not in main DEX file. The question is how to force gradle

4条回答
  •  名媛妹妹
    2021-02-02 18:33

    No need to manually add multi-dex parameters to dex tasks.
    This can be automatically handled by the android plugin (since v0.14.0).

    Remove both the afterEvaluate section and compile('com.android.support:multidex:1.0.0') from your build.gradle, and instead add this:

    android {
       defaultConfig {
          ...
          multiDexEnabled = true
       }
    }
    

    The plugin is smart enough to package all the components (receivers among them) in main dex file.

提交回复
热议问题