Android调试失败“无法连接到logcat,GetProcessId返回:0”FFImageLoading.Platform.dll.so未找到

问题描述 投票:5回答:5

我有调试Android项目的问题。我可以部署到设备并运行它,一切正常但如果我尝试调试,应用程序部署到设备并且非常简短地打开,启动屏幕显示但应用程序然后关闭。

我在Visual Studio 2015上使用Xamarin Forms。

设备正在运行Android Oreo(8.0.0)。运行Android 6.0.1的另一台设备正在调试。

输出显示如下:

InspectorDebugSession(11): StateChange: Start -> EntryPointBreakpointRegistered
InspectorDebugSession(11): Constructed
Android application is debugging.
InspectorDebugSession(11): HandleTargetEvent: TargetExited
InspectorDebugSession(11): Disposed
Couldn't connect to logcat, GetProcessId returned: 0

我检查了Logcat,它似乎遇到了查找FFImageLoading库的问题:

Time    Device Name Type    PID Tag Message
09-18 14:35:52.361  Huawei Nexus 6P Debug   1560    Mono    AOT: 
image '/usr/local/lib/mono/aot-cache/arm/FFImageLoading.Platform.dll.so' 
not found: dlopen failed: library "/data/app/myapp.android.dev-
WEb1bz8edgF7vwx6uCoZ-A==/lib/arm/libaot-FFImageLoading.Platform.dll.so" not found

我已经为我的项目添加了用于FFImageLoading的Nuget包,Droid项目引用如下图所示:

enter image description here

xamarin.forms xamarin.android android-6.0-marshmallow android-8.0-oreo ffimageloading
5个回答
1
投票

这是在Visual Studio for Windows上使用Oreo和Xamarin Android的known issue。它显然适用于Visual Studio for Mac。它将在即将发布的版本中修复。与此同时,在上面的bug链接底部附近有一个工作(评论20)。


10
投票

这对我有用: -

在项目属性> Android选项>包装属性中取消选择“使用共享运行时”


5
投票

我在Android 8.1和Visual Studio 2017 15.7.4中也遇到过这个问题。

让它再次运作有三个步骤。

  1. 在Android选项下,转到高级并添加您的设备架构,在我的情况下它是x86_64。
  2. 转到工具 - >选项 - > Xamarin> Android设置并启用:为共享运行时和基类库提供调试符号。
  3. 最后一步是从您的设备中删除以下应用: 所有Xamarin.Android API支持库 单声道共享运行时 你的应用

执行这些步骤后,您无需禁用“使用共享运行时”,并且可以更快地部署和调试。


1
投票
  1. 在项目属性> Android选项中取消选择“使用共享运行时”
  2. 从解决方案中删除bin和obj文件
  3. 清洁解决方案
  4. 重建它运作的解决方案

0
投票

另一个原因是,如果您不在设备上启用USB调试,VS 2017仍会识别您的手机并在手机上安装该应用程序。在调试开始后,它将抛出此错误而不继续调试。确保启用开发人员模式 - > usb调试,如此处所述https://docs.microsoft.com/en-us/xamarin/android/get-started/installation/set-up-device-for-development

© www.soinside.com 2019 - 2024. All rights reserved.