code: @Override
      public void addFile(File file, String archivePath) throws ApkCreationException,
              SealedApkException, DuplicateFileException {
          if (mIsSealed) {
              throw new SealedApkException("APK is already sealed");
          }
  
          try {
              doAddFile(file, archivePath);
          } catch (DuplicateFileException e) {
              mBuilder.cleanUp();
              throw e;
          } catch (Exception e) {
              mBuilder.cleanUp();
              throw new ApkCreationException(e, "Failed to add %s", file);
          }
      }
docs: Adds a file to the APK at a given path
  @param file the file to add
  @param archivePath the path of the file inside the APK archive.
  @throws ApkCreationException if an error occurred
  @throws SealedApkException if the APK is already sealed.
  @throws DuplicateFileException if a file conflicts with another already added to the APK
  at the same location inside the APK archive.