1

Xamarin Forms Android

Some recent nuget package level is causing this error. We we only using stable packages, but I started trying more recent Xamarin pre- release packages to see if the issue has been resolved.

The part of the Build and Debug Output with error.

Assembly Loader probing location: 'System.Memory'. 07-06 10:10:51.972 F/monodroid-assembly( 4029): Could not load assembly 'System.Memory' during startup registration.

The Compile is set to use Latest(8.1) Minimum version is 7.0

From other posts, i tried deleting shared runtime and tried the Android options with and with used shared runtime checked.

edit 3: Updated output from Debug:

07-06 10:10:48.375 D/Mono ( 4029): AOT: image '/storage/emulated/0/Android/data/com.Oxando.OxandoXPC/files/.override/Xamarin.Forms.Platform.dll.so' not found: dlopen failed: library "/data/app/com.Oxando.OxandoXPC-xDHzK4ivf73vZ_mvi0X4Jg==/lib/x86/libaot-Xamarin.Forms.Platform.dll.so" not found 07-06 10:10:48.376 D/Mono ( 4029): AOT: image '/usr/local/lib/mono/aot-cache/x86/Xamarin.Forms.Platform.dll.so' not found: dlopen failed: library "/data/app/com.Oxando.OxandoXPC-xDHzK4ivf73vZ_mvi0X4Jg==/lib/x86/libaot-Xamarin.Forms.Platform.dll.so" not found 07-06 10:10:48.376 D/Mono ( 4029): Assembly Loader loaded assembly from location: '/storage/emulated/0/Android/data/com.Oxando.OxandoXPC/files/.override/Xamarin.Forms.Platform.dll'. 07-06 10:10:48.376 D/Mono ( 4029): Config attempting to parse: '/storage/emulated/0/Android/data/com.Oxando.OxandoXPC/files/.override/Xamarin.Forms.Platform.dll.config'. 07-06 10:10:48.376 D/Mono ( 4029): Config attempting to parse: '/usr/local/etc/mono/assemblies/Xamarin.Forms.Platform/Xamarin.Forms.Platform.config'. 07-06 10:10:48.376 D/Mono ( 4029): Assembly Loader probing location: '/storage/emulated/0/Android/data/com.Oxando.OxandoXPC/files/.override/Xamarin.Forms.Xaml.dll'. 07-06 10:10:48.376 D/Mono ( 4029): Image addref Xamarin.Forms.Xaml[0xcbf3d2c0] -> /storage/emulated/0/Android/data/com.Oxando.OxandoXPC/files/.override/Xamarin.Forms.Xaml.dll[0xcbf50400]: 2 07-06 10:10:48.376 D/Mono ( 4029): Prepared to set up assembly 'Xamarin.Forms.Xaml' (/storage/emulated/0/Android/data/com.Oxando.OxandoXPC/files/.override/Xamarin.Forms.Xaml.dll) 07-06 10:10:48.376 D/Mono ( 4029): Assembly Xamarin.Forms.Xaml[0xcbf3d2c0] added to domain RootDomain, ref_count=1 07-06 10:10:48.377 D/Mono ( 4029): AOT: image '/storage/emulated/0/Android/data/com.Oxando.OxandoXPC/files/.override/Xamarin.Forms.Xaml.dll.so' not found: dlopen failed: library "/data/app/com.Oxando.OxandoXPC-xDHzK4ivf73vZ_mvi0X4Jg==/lib/x86/libaot-Xamarin.Forms.Xaml.dll.so" not found 07-06 10:10:48.378 D/Mono ( 4029): AOT: image '/usr/local/lib/mono/aot-cache/x86/Xamarin.Forms.Xaml.dll.so' not found: dlopen failed: library "/data/app/com.Oxando.OxandoXPC-xDHzK4ivf73vZ_mvi0X4Jg==/lib/x86/libaot-Xamarin.Forms.Xaml.dll.so" not found 07-06 10:10:48.378 D/Mono ( 4029): Assembly Loader loaded assembly from location: '/storage/emulated/0/Android/data/com.Oxando.OxandoXPC/files/.override/Xamarin.Forms.Xaml.dll'. 07-06 10:10:48.378 D/Mono ( 4029): Config attempting to parse: '/storage/emulated/0/Android/data/com.Oxando.OxandoXPC/files/.override/Xamarin.Forms.Xaml.dll.config'. 07-06 10:10:48.378 D/Mono ( 4029): Config attempting to parse: '/usr/local/etc/mono/assemblies/Xamarin.Forms.Xaml/Xamarin.Forms.Xaml.config'. 07-06 10:10:48.378 D/Mono ( 4029): Assembly Loader probing location: '/storage/emulated/0/Android/data/com.Oxando.OxandoXPC/files/.override/System.Memory.dll'. 07-06 10:10:48.378 D/Mono ( 4029): Image addref System.Memory[0xcbf3d4a0] -> /storage/emulated/0/Android/data/com.Oxando.OxandoXPC/files/.override/System.Memory.dll[0xcbf50e00]: 2 07-06 10:10:48.378 D/Mono ( 4029): Image for assembly 'System.Memory' (/storage/emulated/0/Android/data/com.Oxando.OxandoXPC/files/.override/System.Memory.dll) has ReferenceAssemblyAttribute, skipping 07-06 10:10:48.378 D/Mono ( 4029): Unloading image /storage/emulated/0/Android/data/com.Oxando.OxandoXPC/files/.override/System.Memory.dll [0xcbf50e00]. 07-06 10:10:48.379 D/Mono ( 4029): Assembly Loader probing location: '/usr/local/lib/System.Memory.dll'.Loaded assembly: /storage/emulated/0/Android/data/com.Oxando.OxandoXPC/files/.override/SQLitePCLRaw.batteries_green.dll [External] ...
...
Assembly Loader probing location: 'System.Memory'. 07-06 10:10:51.972 F/monodroid-assembly( 4029): Could not load assembly 'System.Memory' during startup registration. 07-06 10:10:51.972 F/monodroid-assembly( 4029): This might be due to an invalid debug installation. 07-06 10:10:51.972 F/monodroid-assembly( 4029): A common cause is to 'adb install' the app directly instead of doing from the IDE.

3
  • 1
    Have you tried to: Delete bin/obj folders. Uninstall the application from the emulator/phone, restart visual studio, in android options->cancel " use shared runtime " ? Commented Jul 5, 2018 at 10:22
  • Hi Bruno, looks like your idea may have resolved one issue. It now bombs elsewhere :( Commented Jul 5, 2018 at 12:12
  • I have tried ideas. System deploy problem with System.Memory Commented Jul 10, 2018 at 8:25

1 Answer 1

0
Can you try this Go to android Project>Right the Properties>Go to Android options>Advanced>In supported architecture tick all and set Java max Heap Size to 1 G if that not working can you try this 


This seemed to work for me. I will have to do more testing when I get time. Found it on the EF Core git bug lists.

Manually edit your csproj file and define, that the NU1605 warning shouldn't be treated as an error.

<PropertyGroup>
  <NoWarn>$(NoWarn);NU1605</NoWarn>
</PropertyGroup>
Now in your Project File add the Package:

<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="4.3.0" />
Then I would:

Clean the NuGet Caches
Clean all bin and obj folders
Restore the Packages
Build
Sign up to request clarification or add additional context in comments.

5 Comments

x86 is in the list of supported Architectures, i set 1G to Max heap size. im The result is the original error again.
im still testing your suggestion. including the package unsafe manually IM getting conflicts and the error Assembly Loader probing location: 'System.Runtime.CompilerServices.Unsafe'. perhaps the version isnt right
You can add latest from nuget package
with the latest nuget version ofComplierServices.Unsafe (4.5.1) it is now back at Could not load assembly 'System.Memory' during startup registration.
thanks for trying Adit, but it looks like this did get system.Memory loaded.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.