title: How to put specific classes into main DEX file?
body: <p>We found an issue on <code>Amazon market</code> that IAP doesn't work if it's receivers located not in main <code>DEX</code> file.
  The question is how to force <code>gradle</code> to put specific classes (receivers) into main <code>DEX</code> file.</p>
  
  <p>EDIT: updated with gradle DEX settings</p>
  
  <pre><code>afterEvaluate {
      tasks.matching {
          it.name.startsWith('dex')
      }.each { dx -&gt;
          if (dx.additionalParameters == null) {
              dx.additionalParameters = []
          }
      dx.additionalParameters += '--multi-dex'
      dx.additionalParameters += "--main-dex-list=class_files.txt" 
      }
  }
  dexOptions {
      javaMaxHeapSize "4g"
      preDexLibraries = false
  }
  compile('com.android.support:multidex:1.0.0')
  </code></pre>