pdfdartpdf-generationdart-pubdart-webui

Execution failed for task ':app:transformClassesWithMultidexlistForDebug'. Error while generating the main dex list


I'm developing an application which generates a pdf and shares this pdf using Flutter & DART.

I'm importing a library called share_extend: ^1.0.3 in my pubspec.yml file to share the generated pdf.

sharePdf.dart

async {
  String name='John';
  pdfGenerator(name);
  final String downloadPath= await getApplicationDocumentsDirectoryPath();
  final files=File('$downloadPath/$name.pdf').path;
  ShareExtend.share(files,'file');
},

Error : Execution failed for task ':app:transformClassesWithMultidexlistForDebug'. com.android.build.api.transform.TransformException: Error while generating the main dex list.

Please can someone explain to me how to resolve this problem?


Solution

  • You need to migrate your project to AndroidX. https://developer.android.com/jetpack/androidx/migrate