我无法使用pyshical设备运行Flutter应用程序。
使用Android模拟器的过程很吸引人,但不适用于灵巧的设备。
我尝试使用其他设备,但不起作用。
我当然已经安装了
Google USB Driver, rev 11
我也将手机设置为“ USB调试”
使用Android本机项目,在pyshical设备上运行没有问题。
您可能想知道的信息:
Android Studio版本
3.2.1
Flutter&Dart信息
channel beta • https://github.com/flutter/flutter.git Framework
• revision f37c235c32 (4 weeks ago)
• 2018-09-25 17:45:40 -0400 Engine
• revision 74625aed32 Tools • Dart 2.1.0-dev.5.0.flutter-a2eb050044
Dart插件版本
181.5656
Flutter插件版本
29.1.1
在pyshical设备上运行后的错误日志
Error retrieving device properties for ro.product.cpu.abi:
error: device still connecting
Launching lib\main.dart on ZY12332K4T in debug mode...
Initializing gradle...
Resolving dependencies...
error: device still connecting
Unhandled exception:
Exit code 1 from: C:\MySDK\platform-tools\adb -s ZY12332K4T shell -x logcat -v time -t 1
#0 _runWithLoggingSync (package:flutter_tools/src/base/process.dart:351:7)
#1 runCheckedSync (package:flutter_tools/src/base/process.dart:282:10)
#2 AndroidDevice.lastLogcatTimestamp (package:flutter_tools/src/android/android_device.dart:500:27)
#3 _AdbLogReader._start (package:flutter_tools/src/android/android_device.dart:668:41)
#4 _runGuarded (dart:async/stream_controller.dart:804:24)
#5 _BroadcastStreamController._subscribe (dart:async/broadcast_stream_controller.dart:217:7)
#6 _ControllerStream._createSubscription (dart:async/stream_controller.dart:817:19)
#7 _StreamImpl.listen (dart:async/stream_impl.dart:472:9)
#8 FlutterDevice.startEchoingDeviceLog (package:flutter_tools/src/resident_runner.dart:240:71)
#9 FlutterDevice.runHot (package:flutter_tools/src/resident_runner.dart:283:5)
<asynchronous suspension>
#10 HotRunner.run (package:flutter_tools/src/run_hot.dart:262:39)
<asynchronous suspension>
#11 AppDomain.startApp.<anonymous closure> (package:flutter_tools/src/commands/daemon.dart:384:62)
#12 AppDomain.launch.<anonymous closure> (package:flutter_tools/src/commands/daemon.dart:440:26)
<asynchronous suspension>
#13 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:142:29)
<asynchronous suspension>
#14 _rootRun (dart:async/zone.dart:1124:13)
#15 _CustomZone.run (dart:async/zone.dart:1021:19)
#16 _runZoned (dart:async/zone.dart:1516:10)
#17 runZoned (dart:async/zone.dart:1463:12)
#18 AppContext.run (package:flutter_tools/src/base/context.dart:141:18)
<asynchronous suspension>
#19 AppInstance._runInZone (package:flutter_tools/src/commands/daemon.dart:811:20)
#20 AppDomain.launch (package:flutter_tools/src/commands/daemon.dart:438:15)
<asynchronous suspension>
#21 AppDomain.startApp (package:flutter_tools/src/commands/daemon.dart:381:12)
<asynchronous suspension>
#22 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:277:38)
<asynchronous suspension>
#23 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:372:18)
#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:129:18)
#28 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:642:45)
#29 Future._propagateToListeners (dart:async/future_impl.dart:671:32)
#30 Future._complete (dart:async/future_impl.dart:476: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:295:13)
#34 RunCommand.usageValues (package:flutter_tools/src/commands/run.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:129:18)
#39 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:642:45)
#40 Future._propagateToListeners (dart:async/future_impl.dart:671:32)
#41 Future._complete (dart:async/future_impl.dart:476: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)
谢谢
答案 0 :(得分:2)
使用 USB进行文件传输和 USB调试对我有用
使用USB为该设备充电时
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.5.4-hotfix.2, on Linux, locale en_IN)
⣻Error retrieving device properties for ro.product.cpu.abi:
error: insufficient permissions for device: user in plugdev group; are your udev
rules wrong?
See [http://developer.android.com/tools/device.html] for more information
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
[✓] Android Studio (version 3.4)
[✓] Connected device (1 available)
使用USB进行文件传输时
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.5.4-hotfix.2, on Linux, locale en_IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
[✓] Android Studio (version 3.4)
[✓] Connected device (1 available)
• No issues found!
答案 1 :(得分:0)
对我来说,解决方案是更换USB线。我知道这不是您想的解决方案,但是我尝试了另一种USB并像魅力一样工作。
此外,如果您拥有三星手机,则可能需要执行其他操作:
好的编码!
答案 2 :(得分:0)
有一个临时修复程序,您可以按照此链接https://github.com/flutter/flutter/issues/33938#issuecomment-499250288中的步骤进行操作。它对我有用。
答案 3 :(得分:0)
我解决了这个问题,请先完成任务adb和android studio,模拟器等等。
下载此文件:lextotan.com/platform-tools_r28.0.2-windows.zip
并放入您的sdk文件夹文件。例如:C:/ sdk 替换所有文件。
在“工具”>“ SDK管理器”>“ SDK工具”之后打开android studio。 右下角选择“显示软件包详细信息”并安装28.0.3(2,1)
应用,确定。重新启动您的android studio。 并启动您的模拟器。 就是全部
答案 4 :(得分:0)
只需下载此平台工具并将其替换为
C:\ Users \ Username \ AppData \ Local \ Android \ Sdk \ platform-tools
Windows:http://dl-ssl.google.com/android/repository/platform-tools_r28.0.2-windows.zip
macOS:http://dl-ssl.google.com/android/repository/platform-tools_r28.0.2-darwin.zip
Linux:http://dl-ssl.google.com/android/repository/platform-tools_r28.0.2-linux.zip
答案 5 :(得分:-1)
对我来说,解决方案是关闭IDE并将设备与计算机断开连接,然后再次连接。