修改代码后MAUI USB连接安卓设备调试异常问题求助
.NET 8 MAUI安卓调试异常问题:修改代码后应用被后台清理,调试断开
使用.NET 8.0开发MAUI应用时,出现以下问题:修改代码后通过USB连接安卓物理设备进行调试,应用启动数秒后调试自动停止,同时应用被转入后台并被系统清理;将应用切回前台后会重启并正常运行,但此时已与Visual Studio断开调试连接。卸载设备上的应用后可恢复正常,但再次修改代码后问题会复现。调试过程中无异常报告及回溯信息。
相关日志如下:
[OpenGLRenderer] Davey! duration=1053ms; Flags=0, FrameTimelineVsyncId=750240, IntendedVsync=11939588219664, Vsync=11940621552956, InputEventId=0, HandleInputStart=11940627184818, AnimationStart=11940627189245, PerformTraversalsStart=11940627835078, DrawStart=11940628308047, FrameDeadline=11940638251820, FrameInterval=11940626035339, FrameStartTime=16666666, SyncQueued=11940630990078, SyncStart=11940631119089, IssueDrawCommandsStart=11940631489245, SwapBuffers=11940636915703, FrameCompleted=11940642056224, DequeueBufferDuration=36198, QueueBufferDuration=440990, GpuCompleted=11940642056224, SwapBuffersCompleted=11940638637161, DisplayPresentTime=0, CommandSubmissionCompleted=11940636915703, Thread started: .NET Timer #8 [Quality] Skipped: false 3 cost 53.28309 refreshRate 16669135 bit true processName com.mycompany.myapp [VRI[MainActivity]] Received frameCommittedCallback lastAttemptedDrawFrameNum=3 didProduceBuffer=true syncBuffer=false [VRI[MainActivity]] draw finished. [VRI[MainActivity]] reportDrawFinished [Quality] Skipped: false 6 cost 110.21765 refreshRate 16667980 bit true processName com.mycompany.myapp [Quality] Skipped: false 1 cost 18.913912 refreshRate 16667282 bit true processName com.mycompany.myapp [OplusScrollToTopManager] com.mycompany.myapp/crc6476ca92efe8ec1437.MainActivity,This DecorView@88d844b[MainActivity] change focus to true [mycompany.myapp] Explicit concurrent copying GC freed 13427(558KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 6259KB/12MB, paused 26us,14us total 12.446ms [monodroid-assembly] open_from_bundles: failed to load assembly System.Xml.XmlSerializer.dll Loaded assembly: /data/data/com.mycompany.myapp/files/.__override__/System.Xml.XmlSerializer.dll [External] Thread started: <Thread Pool> #9 Thread started: <Thread Pool> #10 Thread started: <Thread Pool> #11 Thread started: <Thread Pool> #12 Thread started: <Thread Pool> #13 Thread started: <Thread Pool> #14 Thread started: <Thread Pool> #15 [ProfileInstaller] Installing profile for com.mycompany.myapp *** At this point everything looks normal, the app is running and usable, but then it gets "cleared" and the only output I get are the following lines: *** [libc] Requested dump for pid 31373 (mycompany.myapp) [Looper] dumpMergedQueue [OplusLooperMsgDispatcher] dumpMsgWhenAnr
已尝试以下操作但均未解决问题:
- 清理并重新生成解决方案
- 清理、删除obj和bin文件夹后重新生成解决方案
- 重启安卓手机
- 重启电脑
- 更新Visual Studio
- 卸载应用(仅在下次修改代码前有效)
内容的提问来源于stack exchange,提问作者mikl
相关产品推荐
相关产品推荐

