Android debugging with error "Could not connect to logcat, GetProcessId returned: 0" FFImageLoading.Platform.dll.so not found

I am having a problem debugging an Android project. I can deploy the device and start it, everything works fine, but if I try to debug, the application will be deployed to the device and will open very shortly, a pop-up screen will appear, but the application will then close.

I am using Xamarin Forms on Visual Studio 2015.

The device is running Android Oreo (8.0.0). Another device running Android 6.0.1 is perfectly debugged.

The output shows the following:

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 

I checked Logcat and it was having trouble finding the FFImageLoading library:

 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 

I added the Nuget package for FFImageLoading to my projects, and the links to the Droid project show it, as in the image below:

enter image description here

+5
source share
4 answers

This is a known issue with Oreo and Xamarin Android in Visual Studio for Windows. It seems to be working on Visual Studio for Mac. This will be recorded in an upcoming release. At the same time, work is going on at the bottom of the link with an error (see Comment 20).

+1
source

It worked for me: -

Deselect Use Shared Workspace in Project Properties> Android Options> Packaging Properties

+10
source

I also had this problem with Android 8.1 and Visual Studio 2017 15.7.4.

There are three steps to get it working again.

  1. In the "Android Settings" section, go to the "Advanced" section and add the architecture of your device, in my case it was x86_64.
  2. Go to Tools -> Options -> Xamarin> Android Settings and enable: Provide debugging symbols for common runtime libraries and base classes.
  3. And the last step is to remove the following applications from your device:

    • All Xamarin.Android API Support Libraries
    • Mono shared runtime
    • Your application

After these steps, you don’t need to turn off β€œUse shared runtime” and you can deploy and debug much faster.

+3
source

Another reason for this is that if you do not enable USB debugging on your device, VS 2017 will still recognize your phone and install the application on your phone. Immediately after starting debugging, it will throw this error and will not continue debugging. Be sure to enable developer mode β†’ USB debugging as described here https://docs.microsoft.com/en-us/xamarin/android/get-started/installation/set-up-device-for-development

0
source

Source: https://habr.com/ru/post/1271914/


All Articles