runtime: Missing initialization of JNI in net6 android app

In a previous version a OpenSSL encryption not rules. In this version: preview-3 encryption produces an error:

[monodroid-assembly] Caching p/invoke entry libSystem.Security.Cryptography.Native.OpenSsl @ AndroidCryptoNative_CipherCreate [monodroid] MonodroidRuntime::monodroid_pinvoke_override ("libSystem.Security.Cryptography.Native.OpenSsl", "AndroidCryptoNative_CipherCreate") [libc] Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 5002 (anyname.Android), pid 5002 (anyname.Android) [monodroid] MonodroidRuntime::monodroid_pinvoke_override ("libSystem.Security.Cryptography.Native.OpenSsl", "AndroidCryptoNative_CipherCreate")

This is my code:

//key is an byte[32] //iv is an byte[16] private static AesCryptoServiceProvider provider = new AesCryptoServiceProvider(); provider.CreateDecryptor(key, iv);

I try copy/paste a code of this page: https://docs.microsoft.com/es-es/dotnet/api/system.security.cryptography.aescryptoserviceprovider?view=net-6.0 When i running this application receive this error:

[monodroid-assembly] Caching p/invoke entry libSystem.Security.Cryptography.Native.OpenSsl @ CryptoNative_GetRandomBytes [monodroid] MonodroidRuntime::monodroid_pinvoke_override ("libSystem.Security.Cryptography.Native.OpenSsl", "CryptoNative_GetRandomBytes") [libc] Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 31815 (.AndroidOpenSSL), pid 31815 (.AndroidOpenSSL) [monodroid] MonodroidRuntime::monodroid_pinvoke_override ("libSystem.Security.Cryptography.Native.OpenSsl", "CryptoNative_GetRandomBytes")

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 19 (12 by maintainers)

Commits related to this issue

Most upvoted comments

@touzas use .Android instead of .Openssl. We changed the name of the library.