idea 写flutter app,重启电脑后项目便宜报错Error:Android Dex: [my_app] Unable to execute DX

当天晚上 项目编译运行正常,关机后,第二天打开项目编译失败,

Information:2019/4/17 22:49 - Compilation completed with 24 errors and 0 warnings in 4 s 598 ms
Error:Android Dex: [my_app] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lorg/gradle/cli/AbstractCommandLineConverter;
Error:Android Dex: [my_app] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lorg/gradle/cli/AbstractPropertiesCommandLineConverter;
Error:Android Dex: [my_app] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lorg/gradle/cli/CommandLineArgumentException;
Error:Android Dex: [my_app] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lorg/gradle/cli/CommandLineConverter;
Error:Android Dex: [my_app] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lorg/gradle/cli/CommandLineOption;
Error:Android Dex: [my_app] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lorg/gradle/cli/CommandLineParser;
Error:Android Dex: [my_app] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lorg/gradle/cli/CommandLineParser$1;
Error:Android Dex: [my_app] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lorg/gradle/cli/CommandLineParser$AfterFirstSubCommand;
Error:Android Dex: [my_app] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lorg/gradle/cli/CommandLineParser$AfterOptions;
Error:Android Dex: [my_app] Unable to execute DX
Error:Android Dex: [my_app] java.lang.RuntimeException: Translation has been interrupted
Error:Android Dex: [my_app] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:614)
Error:Android Dex: [my_app] at com.android.dx.command.dexer.Main.runMonoDex(Main.java:310)
Error:Android Dex: [my_app] at com.android.dx.command.dexer.Main.runDx(Main.java:288)
Error:Android Dex: [my_app] at com.android.dx.command.dexer.Main.run(Main.java:264)
Error:Android Dex: [my_app] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Error:Android Dex: [my_app] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
Error:Android Dex: [my_app] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Error:Android Dex: [my_app] at java.lang.reflect.Method.invoke(Method.java:498)
Error:Android Dex: [my_app] at org.jetbrains.android.compiler.tools.AndroidDxRunner.runDex(AndroidDxRunner.java:201)
Error:Android Dex: [my_app] at org.jetbrains.android.compiler.tools.AndroidDxRunner.main(AndroidDxRunner.java:349)
Error:Android Dex: [my_app] Caused by: java.lang.InterruptedException: Too many errors
Error:Android Dex: [my_app] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:606)
Error:Android Dex: [my_app] ... 9 more

图片说明
请教大神解决!!

2个回答

spping
小迷球 谢谢,你的回答,这个问题已经解决了,一点一点的排查后,返现是加了这个fluttertoast的dependencies后编译出错,当时是2.1.1版本,把它去掉后就不报错了,后来更新了Android studio最新版本,就好了。
9 个月之前 回复

更新 fluttertoast: ^3.0.4
更新了Android studio最新版本,就好了。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问