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
Sergii Pechenizkyi's answar only keep some class in main dex , but not generate two dex. Add --minimal-main-dex
to your builg.gradle
. But this only solve below gradle1.5.0
. You can use DexKnifePlugin to solve your problem.
afterEvaluate {
tasks.matching {
it.name.startsWith('dex')
}.each { dx ->
if (dx.additionalParameters == null) {
dx.additionalParameters = []
}
dx.additionalParameters += '--multi-dex'
dx.additionalParameters += "--main-dex-list=class_files.txt"
dx.additionalParameters += '--minimal-main-dex'
}
}