System.DllNotFoundException: libRuntimeCoreNet

546
7
02-02-2018 04:30 AM
Highlighted
New Contributor

We have Xamarin android app that uses ArcGIS SDK for Xamarin

After the app is installed on the device and I try to lauch it, I get the following exception:

Xamarin caused by: android.runtime.JavaProxyThrowable: System.DllNotFoundException: libRuntimeCoreNet at (wrapper managed-to-native) RuntimeCoreNet.GeneratedWrappers.CoreArcGISRuntimeEnvironment:CoreRT_ArcGISRuntimeEnvironment_enableBreakOnException (bool,intptr&)
at RuntimeCoreNet.GeneratedWrappers.CoreArcGISRuntimeEnvironment.EnableBreakOnException (System.Boolean enable) [0x00000] in :0
at Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.Initialize () [0x00035] in :0
at Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.SetLicense (System.String licenseKey) [0x00009] in :0
at NeoTreks.PlowOps.Android.Activities.MainActivity.OnCreate (Android.OS.Bundle savedInstanceState) [0x0003a] in <2e8073a2350242dc8c655650b4525319>:0
at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_savedInstanceState) [0x0000f] in <3db0c94344514ae1a2cf0f64cb1a487a>:0
at (wrapper dynamic-method) System.Object:cd243ea0-e72b-4ef1-afd9-336733c9c36a (intptr,intptr,intptr)
at md515cc6cdff08daa7d20d96887e3190398.MainActivity.n_onCreate(Native Method)
at md515cc6cdff08daa7d20d96887e3190398.MainActivity.onCreate(MainActivity.java:35)
at android.app.Activity.performCreate(Activity.java:5993)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2375)
at android.app.ActivityThread.access$900(ActivityThread.java:147)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:910)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:705)

Does anyone know what is causing this exception and how to solve it?

We are using Esri.ArcGISRuntime.Xamarin.Android, version 100.2.0

Tags (1)
Reply
0 Kudos
7 Replies
Highlighted
Esri Frequent Contributor

This file should automatically be deployed when deploying the app. It looks like our native library is not getting deployed. Is there any chance you could share a sample that reproduces the problem? I wonder if there's some project setting that is preventing it from happening.

Reply
0 Kudos
Highlighted
New Contributor

I have the same problem with Xamarin Forms (v 2.5.0.280555). There're 2 ways that this error will occur (v100.2.1).

1: Normal Cross Platform Project. If I change Android MainActivity:

- Change FormsAppCompatActivity to FormsApplicationActivity (it is needed in case to show better GUI in master detail page below)

- Comment out TabLayoutResource and ToolbarResource

- Remove: Theme = "@style/MainTheme"

2: When using Master Detail Page - It run normally if the map run on the first Navigation Page (default detail page)

But if I put the map on another Detail Page and load later or on the Detail Page has a button to show map. It give the error libRuntimeCoreNet not found

The Xaml and code is from the default MasterDetaiPage and this tutorial page: ArcGIS map image layer (URL)—ArcGIS Runtime SDK for .NET Samples | ArcGIS for Developers 

Any suggestion to fix this problem?

Reply
0 Kudos
Highlighted
Esri Frequent Contributor

Is your device running an Android version older than Level 18?

Could you try in the Application constructor and add the following line:

    Java.Lang.JavaSystem.LoadLibrary("runtimecore");

Reply
0 Kudos
Highlighted
New Contributor

I will try to create a sample later if I will have time. In the end we solved the problem by downgrading back to version 100.1.0 which does not have this problem.

Reply
0 Kudos
Highlighted
Esri Frequent Contributor

PetrPokorny‌ Did you try my suggestion with the LoadLibrary call? Also could you share some details about the device you're using (device type, OS, version etc)

Reply
0 Kudos
Highlighted
New Contributor

Hi Morten - I just done the test - upgraded to  SDK 100.2.1 and I added call Java.Lang.JavaSystem.LoadLibrary("runtimecore"); to Application constructor and it works. Without the call in constructor, I get the exception mentioned above.

This is happening on real device - Xiaomi Mi2s, Android 5.0.2, we use target framework 8.0 (oreo) and minimum API level Android 5.0 (Api level 21)

I never had this problem on iOS or Android emulator.

Thank you!

Petr

Reply
0 Kudos
Highlighted
Esri Frequent Contributor

Thank you for confirming this resolves your issue. We'll try and have this automatically done in the next update.

I'm rather surprised this is an issue on a level 21 device, as this doesn't really match the documentation that covers this issue, and we haven't seen that issue internally either.

Reply
0 Kudos