diff --git a/src/main/java/com/android/tools/r8/R8.java b/src/main/java/com/android/tools/r8/R8.java
index 2efe014..fbcd34c 100644
--- a/src/main/java/com/android/tools/r8/R8.java
+++ b/src/main/java/com/android/tools/r8/R8.java
@@ -207,6 +207,7 @@
       RootSet rootSet;
       byte[] proguardSeedsData = null;
       timing.begin("Strip unused code");
+      Set<DexType> mainDexBaseClasses = null;
       try {
         Set<DexType> missingClasses = appInfo.getMissingClasses();
         missingClasses = filterMissingClasses(missingClasses, options.dontWarnPatterns);
@@ -280,7 +281,7 @@
         // Lets find classes which may have code executed before secondary dex files installation.
         RootSet mainDexRootSet =
             new RootSetBuilder(application, appInfo, options.mainDexKeepRules).run(executorService);
-        Set<DexType> mainDexBaseClasses = enqueuer.traceMainDex(mainDexRootSet, timing);
+        mainDexBaseClasses = enqueuer.traceMainDex(mainDexRootSet, timing);
 
         // Calculate the automatic main dex list according to legacy multidex constraints.
         // Add those classes to an eventual manual list of classes.
diff --git a/src/main/java/com/android/tools/r8/dex/ApplicationWriter.java b/src/main/java/com/android/tools/r8/dex/ApplicationWriter.java
index 3638c01..7476792 100644
--- a/src/main/java/com/android/tools/r8/dex/ApplicationWriter.java
+++ b/src/main/java/com/android/tools/r8/dex/ApplicationWriter.java
@@ -6,7 +6,6 @@
 import com.android.tools.r8.dex.VirtualFile.FilePerClassDistributor;
 import com.android.tools.r8.dex.VirtualFile.FillFilesDistributor;
 import com.android.tools.r8.dex.VirtualFile.PackageMapDistributor;
-import com.android.tools.r8.errors.CompilationError;
 import com.android.tools.r8.graph.AppInfo;
 import com.android.tools.r8.graph.DexAnnotation;
 import com.android.tools.r8.graph.DexAnnotationSet;
@@ -125,16 +124,6 @@
         assert packageDistribution == null :
             "Cannot combine package distribution definition with file-per-class option.";
         distributor = new FilePerClassDistributor(this);
-      } else if (options.minApiLevel < Constants.ANDROID_L_API
-            && options.mainDexKeepRules.isEmpty()
-            && application.mainDexList.isEmpty()) {
-        if (packageDistribution != null) {
-          throw new CompilationError("Cannot apply package distribution. Multidex is not"
-              + " supported with API level " + options.minApiLevel +"."
-              + " For API level < " + Constants.ANDROID_L_API + ", main dex classes list or"
-              + " rules must be specified.");
-        }
-        distributor = new VirtualFile.MonoDexDistributor(this);
       } else if (packageDistribution != null) {
         distributor = new PackageMapDistributor(this, packageDistribution, executorService);
       } else {
diff --git a/src/main/java/com/android/tools/r8/dex/Constants.java b/src/main/java/com/android/tools/r8/dex/Constants.java
index 3ea63bb..201fc82 100644
--- a/src/main/java/com/android/tools/r8/dex/Constants.java
+++ b/src/main/java/com/android/tools/r8/dex/Constants.java
@@ -10,7 +10,6 @@
 
   public static final int ANDROID_O_API = 26;
   public static final int ANDROID_N_API = 24;
-  public static final int ANDROID_L_API = 21;
   public static final int ANDROID_K_API = 19;
   public static final int DEFAULT_ANDROID_API = 1;
 
diff --git a/src/main/java/com/android/tools/r8/dex/VirtualFile.java b/src/main/java/com/android/tools/r8/dex/VirtualFile.java
index 95fc27a..3db0502 100644
--- a/src/main/java/com/android/tools/r8/dex/VirtualFile.java
+++ b/src/main/java/com/android/tools/r8/dex/VirtualFile.java
@@ -309,27 +309,6 @@
     }
   }
 
-  public static class MonoDexDistributor extends DistributorBase {
-    public MonoDexDistributor(ApplicationWriter writer) {
-      super(writer);
-    }
-
-    @Override
-    public Map<Integer, VirtualFile> run() throws ExecutionException, IOException {
-      VirtualFile mainDexFile = new VirtualFile(0, writer.namingLens);
-      nameToFileMap.put(0, mainDexFile);
-
-      for (DexProgramClass programClass : classes) {
-        mainDexFile.addClass(programClass);
-        if (mainDexFile.isFull()) {
-          throw new CompilationError("Cannot fit all classes in a single dex file.");
-        }
-      }
-      mainDexFile.commitTransaction();
-      return nameToFileMap;
-    }
-  }
-
   public static class PackageMapDistributor extends DistributorBase {
     private final PackageDistribution packageDistribution;
     private final ExecutorService executorService;
diff --git a/src/main/java/com/android/tools/r8/ir/desugar/InterfaceMethodRewriter.java b/src/main/java/com/android/tools/r8/ir/desugar/InterfaceMethodRewriter.java
index c3f2d08..baaf7d0 100644
--- a/src/main/java/com/android/tools/r8/ir/desugar/InterfaceMethodRewriter.java
+++ b/src/main/java/com/android/tools/r8/ir/desugar/InterfaceMethodRewriter.java
@@ -166,7 +166,7 @@
 
   private boolean isInMainDexList(DexType iface) {
     ImmutableSet<DexType> list = converter.application.mainDexList;
-    return list.contains(iface);
+    return list != null && list.contains(iface);
   }
 
   // Represent a static interface method as a method of companion class.
diff --git a/src/test/java/com/android/tools/r8/dex/ExtraFileTest.java b/src/test/java/com/android/tools/r8/dex/ExtraFileTest.java
index 9fcf8c2..376577c 100644
--- a/src/test/java/com/android/tools/r8/dex/ExtraFileTest.java
+++ b/src/test/java/com/android/tools/r8/dex/ExtraFileTest.java
@@ -47,7 +47,6 @@
         R8Command.builder()
             .addProgramFiles(original)
             .setOutputPath(out)
-            .setMinApiLevel(Constants.ANDROID_N_API) // Allow native multidex.
             .setProguardMapFile(proguardMap)
             .setPackageDistributionFile(packageMap)
             .build();
diff --git a/src/test/java/com/android/tools/r8/maindexlist/MainDexListTests.java b/src/test/java/com/android/tools/r8/maindexlist/MainDexListTests.java
index fe9caab..f540bc0 100644
--- a/src/test/java/com/android/tools/r8/maindexlist/MainDexListTests.java
+++ b/src/test/java/com/android/tools/r8/maindexlist/MainDexListTests.java
@@ -111,8 +111,7 @@
     if (!verifyApplications && !regenerateApplications) {
       return;
     }
-    AndroidApp generated =
-        generateApplication(TWO_LARGE_CLASSES, Constants.ANDROID_N_API, MAX_METHOD_COUNT);
+    AndroidApp generated = generateApplication(TWO_LARGE_CLASSES, MAX_METHOD_COUNT);
     if (regenerateApplications) {
       generated.write(getTwoLargeClassesAppPath(), OutputMode.Indexed, true);
     } else {
@@ -127,7 +126,7 @@
     if (!verifyApplications && !regenerateApplications) {
       return;
     }
-    AndroidApp generated = generateApplication(MANY_CLASSES, Constants.DEFAULT_ANDROID_API, 1);
+    AndroidApp generated = generateApplication(MANY_CLASSES, 1);
     if (regenerateApplications) {
       generated.write(getManyClassesAppPath(), OutputMode.Indexed, true);
     } else {
@@ -369,11 +368,10 @@
     }
   }
 
-  private static AndroidApp generateApplication(List<String> classes, int minApi, int methodCount)
+  private static AndroidApp generateApplication(List<String> classes, int methodCount)
       throws IOException, ExecutionException {
     Timing timing = new Timing("MainDexListTests");
     InternalOptions options = new InternalOptions();
-    options.minApiLevel = minApi;
     DexItemFactory factory = options.itemFactory;
     DexApplication.Builder builder = new DexApplication.Builder(factory, timing);
     for (String clazz : classes) {
diff --git a/src/test/java/com/android/tools/r8/maindexlist/two-large-classes.zip b/src/test/java/com/android/tools/r8/maindexlist/two-large-classes.zip
index ef4af5b..9ad745f 100644
--- a/src/test/java/com/android/tools/r8/maindexlist/two-large-classes.zip
+++ b/src/test/java/com/android/tools/r8/maindexlist/two-large-classes.zip
Binary files differ
