颤振失去了与具有新USB的设备的连接

时间:2020-05-06 15:58:03

标签: android visual-studio android-studio flutter adb

因此,我的量产Flutter应用程序运行正常,但是很不幸,我的USB损坏了。所以我买了两个新的USB。但是从那以后,每次运行我的项目时,我都会遇到以下错误:

Launching lib\main.dart on RMX1801 in debug mode...
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
√ Built build\app\outputs\apk\debug\app-debug.apk.
D/FlutterActivity(32205): Using the launch theme as normal theme.
D/FlutterActivityAndFragmentDelegate(32205): Setting up FlutterEngine.
D/FlutterActivityAndFragmentDelegate(32205): No preferred FlutterEngine was provided. Creating a new FlutterEngine for this FlutterFragment.
W/FlutterEngine(32205): Tried to automatically register plugins with FlutterEngine (io.flutter.embedding.engine.FlutterEngine@4bc4669) but could not find and invoke the GeneratedPluginRegistrant.
D/FlutterActivityAndFragmentDelegate(32205): Attaching FlutterEngine to the Activity that owns this Fragment.
E/ANR_LOG (32205): >>> msg's executing time is too long
E/ANR_LOG (32205): Blocked msg = { when=-3s964ms what=159 target=android.app.ActivityThread$H obj=android.app.servertransaction.ClientTransaction@3a98be19 } , cost  = 2508 ms
E/ANR_LOG (32205): >>>Current msg List is:
E/ANR_LOG (32205): Current msg <1>  = { when=-3s416ms what=149 target=android.app.ActivityThread$H obj=android.os.BinderProxy@838d0b7 }
E/ANR_LOG (32205): Current msg <2>  = { when=-2s754ms what=131 target=android.app.ActivityThread$H obj=android.app.ActivityThread$ProviderRefCount@bb74efe }
E/ANR_LOG (32205): Current msg <3>  = { when=-2s550ms what=0 target=com.google.android.gms.internal.firebase_auth.zzj callback=com.google.firebase.auth.zzm }
E/ANR_LOG (32205): Current msg <4>  = { when=-2s480ms what=0 target=android.app.ActivityThread$H callback=android.app.LoadedApk$ServiceDispatcher$RunConnection }
E/ANR_LOG (32205): Current msg <5>  = { when=-2s319ms what=0 target=android.app.ActivityThread$H callback=android.app.LoadedApk$ServiceDispatcher$RunConnection }
E/ANR_LOG (32205): Current msg <6>  = { when=-1s894ms what=1 target=android.os.AsyncTask$InternalHandler obj=android.os.AsyncTask$AsyncTaskResult@d92365f }
E/ANR_LOG (32205): Current msg <7>  = { when=-340ms what=131 target=android.app.ActivityThread$H obj=android.app.ActivityThread$ProviderRefCount@4c48ac }
E/ANR_LOG (32205): Current msg <8>  = { when=-105ms what=0 target=android.app.ActivityThread$H callback=android.app.LoadedApk$ServiceDispatcher$RunConnection }
E/ANR_LOG (32205): Current msg <9>  = { when=-97ms what=0 target=android.os.Handler callback=io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2 }
E/ANR_LOG (32205): Current msg <10>  = { when=-70ms what=0 target=android.view.ViewRootImpl$ViewRootHandler callback=android.view.ViewRootImpl$4 }
E/ANR_LOG (32205): >>>CURRENT MSG DUMP OVER<<<
D/FlutterView(32205): Attaching to a FlutterEngine: io.flutter.embedding.engine.FlutterEngine@4bc4669
W/Ads     (32205): Update ad debug logging enablement as false
W/.vedx.mentor10(32205): create CommonDcsHelper
W/.vedx.mentor10(32205): cacheJniMembers success
W/.vedx.mentor10(32205): constructJavaHashMap: start
W/.vedx.mentor10(32205): constructJavaHashMap: end
W/.vedx.mentor10(32205): sendCommonDcs: start
W/.vedx.mentor10(32205): sendCommonDcs: end
W/.vedx.mentor10(32205): Accessing hidden method Landroid/view/accessibility/AccessibilityNodeInfo;->getSourceNodeId()J (light greylist, reflection)
W/.vedx.mentor10(32205): constructJavaHashMap: start
W/.vedx.mentor10(32205): constructJavaHashMap: end
W/.vedx.mentor10(32205): sendCommonDcs: start
W/.vedx.mentor10(32205): sendCommonDcs: end
W/.vedx.mentor10(32205): Accessing hidden method Landroid/view/accessibility/AccessibilityRecord;->getSourceNodeId()J (light greylist, reflection)
W/.vedx.mentor10(32205): constructJavaHashMap: start
W/.vedx.mentor10(32205): constructJavaHashMap: end
W/.vedx.mentor10(32205): sendCommonDcs: start
W/.vedx.mentor10(32205): sendCommonDcs: end
W/.vedx.mentor10(32205): Accessing hidden field Landroid/view/accessibility/AccessibilityNodeInfo;->mChildNodeIds:Landroid/util/LongArray; (light greylist, reflection)
W/.vedx.mentor10(32205): constructJavaHashMap: start
W/.vedx.mentor10(32205): constructJavaHashMap: end
W/.vedx.mentor10(32205): sendCommonDcs: start
W/.vedx.mentor10(32205): sendCommonDcs: end
W/.vedx.mentor10(32205): Accessing hidden method Landroid/util/LongArray;->get(I)J (light greylist, reflection)
D/FlutterActivityAndFragmentDelegate(32205): Executing Dart entrypoint: main, and sending initial route: /
I/Choreographer(32205): Skipped 6 frames!  The application may be doing too much work on its main thread.
I/OpenGLRenderer(32205): Initialized EGL, version 1.4
D/OpenGLRenderer(32205): Swap behavior 2
E/Parcel  (32205): Reading a NULL string not supported here.
I/Choreographer(32205): Skipped 24 frames!  The application may be doing too much work on its main thread.
E/Parcel  (32205): Reading a NULL string not supported here.
D/FlutterView(32205): Detaching from a FlutterEngine: io.flutter.embedding.engine.FlutterEngine@4bc4669
E/Parcel  (32205): Reading a NULL string not supported here.
Lost connection to device.
Exited (sigterm)

USB中没有物理损坏,并且在运行前它确实显示已连接的设备。但是运行Visual Studio代码和android Studio之后,它们都会显示连接断开。

Flutter Doctor:

[√] Flutter (Channel stable, v1.12.13+hotfix.9, on Microsoft Windows [Version 10.0.18362.778], locale en-US)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[√] Android Studio (version 3.6)
[√] VS Code (version 1.44.2)
[√] Connected device (1 available)

• No issues found!

我正在使用Windows 10和Android设备。我想在真实设备中测试和调试我的应用。有解决办法吗?

3 个答案:

答案 0 :(得分:1)

您只需通过USB调试即可。否则,您可以通过LAN连接设备。

https://android.jlelse.eu/wireless-debugging-through-adb-in-android-using-wifi-965f7edd163a

答案 1 :(得分:0)

您是否尝试从手机/模拟器手动卸载并运行flutter clean, 还尝试禁用chrome中的dart devtools自动打开

答案 2 :(得分:0)

尝试创建一个新的默认flutter项目并将其调试到手机中。