在连接的设备上运行Flutter应用程序时出现问题

时间:2019-03-03 03:14:48

标签: android flutter adb

我在运行Ubuntu的新笔记本电脑上设置了android studio,flutter等。我在连接的Android手机上运行我的应用没有运气。在使用同一部手机的另一台笔记本电脑上进行的相同设置非常有效。当我列出设备时,我得到:

flutter devices
1 connected device:

Error retrieving device properties for ro.product.cpu.abi:
error: device still authorizing


FA81J1A00396 • FA81J1A00396 • android-arm • Android null (API null)

运行该应用程序时,我看到:

flutter run -d FA81J1A00396 ./lib/main.dart 
Error retrieving device properties for ro.hardware:
error: device still authorizing


Launching ./lib/main.dart on FA81J1A00396 in debug mode...
Initializing gradle...                                              3.3s
Resolving dependencies...                                          39.4s
error: device still authorizing
Unhandled exception:
Exit code 1 from: adb -s FA81J1A00396 shell -x logcat -v time -t 1
#0      _runWithLoggingSync (package:flutter_tools/src/base/process.dart:352:7)
#1      runCheckedSync (package:flutter_tools/src/base/process.dart:283:10)
#2      AndroidDevice.lastLogcatTimestamp (package:flutter_tools/src/android/android_device.dart:507:27)
#3      _AdbLogReader._start (package:flutter_tools/src/android/android_device.dart:681:41)
#4      _runGuarded (dart:async/stream_controller.dart:805:24)
#5      _BroadcastStreamController._subscribe (dart:async/broadcast_stream_controller.dart:213:7)
#6      _ControllerStream._createSubscription (dart:async/stream_controller.dart:818:19)
#7      _StreamImpl.listen (dart:async/stream_impl.dart:472:9)
#8      FlutterDevice.startEchoingDeviceLog (package:flutter_tools/src/resident_runner.dart:261:71)
#9      FlutterDevice.runHot (package:flutter_tools/src/resident_runner.dart:304:5)
<asynchronous suspension>
#10     HotRunner.run (package:flutter_tools/src/run_hot.dart:295:39)
<asynchronous suspension>
#11     RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:405:37)
<asynchronous suspension>
#12     FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:545:18)
#13     _asyncThenWrapperHelper.<anonymous closure> (dart:async/runtime/libasync_patch.dart:77:64)
#14     _rootRunUnary (dart:async/zone.dart:1132:38)
#15     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#16     _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
#17     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
#18     Future._propagateToListeners (dart:async/future_impl.dart:668:32)
#19     Future._complete (dart:async/future_impl.dart:473:7)
#20     _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#21     _AsyncAwaitCompleter.complete (dart:async/runtime/libasync_patch.dart:28:18)
#22     _completeOnAsyncReturn (dart:async/runtime/libasync_patch.dart:294:13)
#23     RunCommand.usageValues (package:flutter_tools/src/commands/run.dart)
#24     _asyncThenWrapperHelper.<anonymous closure> (dart:async/runtime/libasync_patch.dart:77:64)
#25     _rootRunUnary (dart:async/zone.dart:1132:38)
#26     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#27     _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
#28     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
#29     Future._propagateToListeners (dart:async/future_impl.dart:668:32)
#30     Future._complete (dart:async/future_impl.dart:473:7)
#31     _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#32     _AsyncAwaitCompleter.complete (dart:async/runtime/libasync_patch.dart:28:18)
#33     _completeOnAsyncReturn (dart:async/runtime/libasync_patch.dart:294:13)
#34     AndroidDevice.targetPlatform (package:flutter_tools/src/android/android_device.dart)
#35     _asyncThenWrapperHelper.<anonymous closure> (dart:async/runtime/libasync_patch.dart:77:64)
#36     _rootRunUnary (dart:async/zone.dart:1132:38)
#37     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#38     _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
#39     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
#40     Future._propagateToListeners (dart:async/future_impl.dart:668:32)
#41     Future._complete (dart:async/future_impl.dart:473:7)
#42     _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#43     _AsyncAwaitCompleter.complete.<anonymous closure> (dart:async/runtime/libasync_patch.dart:33:20)
#44     _rootRun (dart:async/zone.dart:1124:13)
#45     _CustomZone.run (dart:async/zone.dart:1021:19)
#46     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
#47     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#48     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#49     _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:115:13)
#50     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:172:5)

我可以向可以提供帮助的任何人提供更多信息。希望有人能指出我正确的方向。

1 个答案:

答案 0 :(得分:0)

github的flutter存储库中有一个封闭的issue,这个家伙和您的问题完全一样,但是在一台windows的机器上,他设法解决了这个问题并通过重新安装整个android来解决了问题开发环境。我知道这是奇怪的解决方案,但对他有用。