Flutter应用Android Studio 3.2.1,构建失败

时间:2018-10-27 08:33:14

标签: build flutter apk proguard

我将Android Studio更新至3.2.1,并在Mac终端中运行“ flutter build apk”,它显示以下错误。在更新Android Studio之前,我能够成功构建apk。

MessageBox

与我的proguard-rules.pro

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> Job failed, see logs for details

2 个答案:

答案 0 :(得分:1)

这解决了我的问题,

 #Flutter Wrapper
-keep class io.flutter.app.** { *; }
-keep class io.flutter.plugin.**  { *; }
-keep class io.flutter.util.**  { *; }
-keep class io.flutter.view.**  { *; }
-keep class io.flutter.**  { *; }
-keep class io.flutter.plugins.**  { *; }
-dontwarn android.**

在此处检查说明: https://github.com/flutter/flutter/issues/40218#issuecomment-531047713

答案 1 :(得分:0)

转到android / app / build.gradle并尝试minifyEnabled false应该起作用