Flutter应用程序未在发布模式下运行,但在调试和配置文件中运行

时间:2019-10-19 18:18:38

标签: flutter dart

我制作了一个带有抖动的应用程序,并在上次编辑之前运行了10次以上,并且上次编辑没有添加任何新内容,但在发布模式下进行了迭代(没有新内容),并生成了没有错误的应用程序 即使运行

,问题也没有任何错误或错误
flutter run -v

所有的颤动是什么问题?  我已经尝试过

flutter clean 

没有任何好的结果 它只会给出:

Running Gradle task 'assembleRelease'...
Finished with error: Gradle task assembleRelease failed with exit code 1

这是flutter run -v 日志:(最后)

+file:///C:/flutter/packages/flutter/lib/src/widgets/draggable_scrollable_sheet.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/scroll_notification.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/editable_text.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/fade_in_image.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/focus_manager.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/focus_scope.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/focus_traversal.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/form.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/framework.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/gesture_detector.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/grid_paper.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/heroes.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/icon.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/icon_data.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/icon_theme.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/icon_theme_data.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/image.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/image_icon.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/implicit_animations.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/inherited_model.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/inherited_notifier.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/inherited_theme.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/layout_builder.dart
[        ] ->
+file:///C:/flutter/packages/flutter/lib/src/widgets/list_wheel_scroll_view.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/localizations.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/media_query.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/modal_barrier.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/navigation_toolbar.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/navigator.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/nested_scroll_view.dart
[        ] ->
+file:///C:/flutter/packages/flutter/lib/src/widgets/notification_listener.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/orientation_builder.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/overlay.dart
[        ] ->
+file:///C:/flutter/packages/flutter/lib/src/widgets/overscroll_indicator.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/page_storage.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/page_view.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/pages.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/performance_overlay.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/placeholder.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/platform_view.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/preferred_size.dart
[   +1 ms] ->
+file:///C:/flutter/packages/flutter/lib/src/widgets/primary_scroll_controller.dart
[   +3 ms] ->
+file:///C:/flutter/packages/flutter/lib/src/widgets/raw_keyboard_listener.dart
[        ] ->
+file:///C:/flutter/packages/flutter/lib/src/widgets/route_notification_messages.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/routes.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/safe_area.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/scroll_activity.dart
[        ] ->
+file:///C:/flutter/packages/flutter/lib/src/widgets/scroll_configuration.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/scroll_context.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/scroll_controller.dart
[   +1 ms] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/scroll_metrics.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/scroll_physics.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/scroll_position.dart
[        ] ->
+file:///C:/flutter/packages/flutter/lib/src/widgets/scroll_position_with_single_context.da
rt
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/scroll_simulation.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/scroll_view.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/scrollable.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/scrollbar.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/semantics_debugger.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/shortcuts.dart
[        ] ->
+file:///C:/flutter/packages/flutter/lib/src/widgets/single_child_scroll_view.dart
[        ] ->
+file:///C:/flutter/packages/flutter/lib/src/widgets/size_changed_layout_notifier.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/sliver.dart
[        ] ->
+file:///C:/flutter/packages/flutter/lib/src/widgets/sliver_layout_builder.dart
[        ] ->
+file:///C:/flutter/packages/flutter/lib/src/widgets/sliver_persistent_header.dart
[        ] ->
+file:///C:/flutter/packages/flutter/lib/src/widgets/sliver_prototype_extent_list.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/spacer.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/status_transitions.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/table.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/text.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/text_selection.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/texture.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/title.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/transitions.dart
[   +1 ms] ->
+file:///C:/flutter/packages/flutter/lib/src/widgets/tween_animation_builder.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/unique_widget.dart
[        ] ->
+file:///C:/flutter/packages/flutter/lib/src/widgets/value_listenable_builder.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/viewport.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/visibility.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/widget_inspector.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/widget_span.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/src/widgets/will_pop_scope.dart
[        ] -> +file:///C:/flutter/packages/flutter/lib/widgets.dart
[        ] -> 23afc489-318a-4a2d-907e-ac56ab8f5af7 build\app.dill 0
[        ] Updating files
[+1426 ms] DevFS: Sync finished
[   +2 ms] Syncing files to device D2502... (completed in 11,349ms, longer than expected)
[   +1 ms] Synced 1.9MB.
[   +1 ms] Sending to VM service: _flutter.listViews({})
[   +6 ms] Result: {type: FlutterViewList, views: [{type: FlutterView, id:
_flutterView/0xb857af90, isolate: {type: @Isolate, fixedId: true, id:
isolates/4097145620960107, name: main.dart$main-4097145620960107, number:
4097145620960107}}]}
[   +1 ms] <- accept
[        ] Connected to _flutterView/0xb857af90.
[   +6 ms] �  To hot reload changes while running, press "r". To hot restart (and rebuild
state),
           press "R".
[  +63 ms] An Observatory debugger and profiler on D2502 is available at:
           http://127.0.0.1:56602/ug-EV7uiGhQ=/
[   +1 ms] For a more detailed help message, press "h". To detach, press "d"; to quit,
press "q".

编辑:: 运行flutter run --release时:

C:\FlutterApps\PrintTouch>flutter run --release
Initializing gradle...                                              2.0s
Resolving dependencies...                                           7.8s
Launching lib\main.dart on D2502 in release mode...
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done                      79.8s
Gradle task assembleRelease failed with exit code 1

编辑2:(运行flutter build apk -v

时)
gradle task assembleRelease failed with exit code 1

#0      throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
#1      _buildGradleProjectV2 (package:flutter_tools/src/android/gradle.dart:765:5)
<asynchronous suspension>
#2      buildGradleProject (package:flutter_tools/src/android/gradle.dart:505:14)
<asynchronous suspension>
#3      _AndroidBuilderImpl.buildApk (package:flutter_tools/src/android/android_builder.dart:101:11)
<asynchronous suspension>
#4      BuildApkCommand.runCommand (package:flutter_tools/src/commands/build_apk.dart:102:26)
<asynchronous suspension>
#5      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:490:18)
#6      _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#7      _rootRunUnary (dart:async/zone.dart:1132:38)
#8      _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#9      _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#10     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#11     Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#12     Future._completeWithValue (dart:async/future_impl.dart:522:5)
#13     Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:552:7)
#14     _rootRun (dart:async/zone.dart:1124:13)
#15     _CustomZone.run (dart:async/zone.dart:1021:19)
#16     _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#17     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#18     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#19     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#20     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:116:13)
#21     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:173:5)

EDIT#3: 尝试运行 flutter run --realease -v ::

Gradle task assembleRelease failed with exit code 1

#0      throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
#1      _buildGradleProjectV2 (package:flutter_tools/src/android/gradle.dart:765:5)
<asynchronous suspension>
#2      buildGradleProject (package:flutter_tools/src/android/gradle.dart:505:14)
<asynchronous suspension>
#3      _AndroidBuilderImpl.buildApk (package:flutter_tools/src/android/android_builder.dart:101:11)
<asynchronous suspension>
#4      AndroidDevice.startApp (package:flutter_tools/src/android/android_device.dart:485:28)
<asynchronous suspension>
#5      FlutterDevice.runCold (package:flutter_tools/src/resident_runner.dart:438:46)
<asynchronous suspension>
#6      ColdRunner.run (package:flutter_tools/src/run_cold.dart:63:39)
<asynchronous suspension>
#7      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:460:37)
<asynchronous suspension>
#8      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:490:18)
#9      _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#10     _rootRunUnary (dart:async/zone.dart:1132:38)
#11     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#12     _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#13     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#14     Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#15     Future._completeWithValue (dart:async/future_impl.dart:522:5)
#16     _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:30:15)
#17     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:288:13)
#18     RunCommand.usageValues (package:flutter_tools/src/commands/run.dart)
#19     _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#20     _rootRunUnary (dart:async/zone.dart:1132:38)
#21     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#22     _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#23     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#24     Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#25     Future._completeWithValue (dart:async/future_impl.dart:522:5)
#26     _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:30:15)
#27     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:288:13)
#28     AndroidDevice.isLocalEmulator (package:flutter_tools/src/android/android_device.dart)
#29     _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#30     _rootRunUnary (dart:async/zone.dart:1132:38)
#31     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#32     _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#33     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#34     Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#35     Future._completeWithValue (dart:async/future_impl.dart:522:5)
#36     Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:552:7)
#37     _rootRun (dart:async/zone.dart:1124:13)
#38     _CustomZone.run (dart:async/zone.dart:1021:19)
#39     _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#40     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#41     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#42     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#43     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:116:13)
#44     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:173:5)

0 个答案:

没有答案