1.创建目录并将 .so 文件复制到项目目录下。
2. 将编译选项调整为 AndroidNativeLibrary。
using Android.App; using Android.Widget; using Android.OS; using System.Runtime.InteropServices; namespace App2 { [Activity(Label = "App2", MainLauncher = true, Icon = "@drawable/icon")] public class MainActivity : Activity { [DllImport("TestDynamicSharedLib.so")] public extern static int getClickCount(); protected override void OnCreate(Bundle bundle) { var c = getClickCount(); base.OnCreate(bundle); // Set our view from the "main" layout resource // SetContentView (Resource.Layout.Main); } } }