在flutter run 运行程序是出现如下错误,当时蛋疼的一B,查了一下原来是设置了删除无用资源导致的。
* Error running Gradle:
ProcessException: Process "/Users/Na/Desktop/dd/FlutterProject/flutter_http/android/gradlew" exited abnormally:
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/NN/Desktop/NN/FlutterProject/flutter_http/android/build.gradle' line: 34
* What went wrong:
A problem occurred evaluating root project 'android'.
> A problem occurred configuring project ':app'.
> Removing unused resources requires unused code shrinking to be turned on. See http://d.android.com/r/tools/shrink-resources.html for more information.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
解决办法删除以下两项再次运行解决上述问题。
zipAlignEnabled true//内存对齐 // 移除无用的resource文件 shrinkResources true