1

I built a native plugin (shared library, .so) for ARM64-v8 on android platform.

It works well with the plain android apps.

But, when the Unity3D loads it, I just got an error message with "... .so is 64-bit instead of 32-bit....".

I just tried to use il2cpp to build the 64-bit app with Unity3D, but it also doesn't work.

Does the Unity3D not support 64-bit native plugin on android platform?

Or

How can I use it, 64-bit native plugin on android platform?

Please let me get some idea.

Thanks.

Currently the tools what I use are as follow:

OS - Windows 10 64-bit

Unity3D (Editor?) - 5.5.03f Personal (64-bit)

AndroidNDK64 - android NDK r10e for il2cpp

  • What directory in your Unity Project did you put the .so plugin? – Programmer Jan 26 '17 at 04:35
  • @Programmer I have just tried it in Assets/Plugins. – TwisTeDStRiDeR Jan 26 '17 at 15:06
  • No. There are two known valid [directory](https://docs.unity3d.com/Manual/PluginsForAndroid.html) for Android plugin. `Assets/Plugins/Android/libs/x86/` **and** `Assets/Plugins/Android/libs/armeabi-v7a/`. Put it in `Assets/Plugins/Android/libs/x86_64/`. Let me know if that actually work. x86_64 is for 64 bit. Maybe it is not supported but try that first. – Programmer Jan 26 '17 at 15:15

1 Answers1

4

Unity does not currently support 64-bit native plugins on Android. So you must use a 32-bit version. Notice the values for the "Architecture" option in the Player Settings for the Android target (in the Unity Editor). They are ARMv7 and x86, both 32-bit architectures.

Unity could support 64-bit targets for Android at some point in the future, but I don't know of any current plans to do so.

Josh Peterson
  • 2,299
  • 19
  • 21
  • This is what I thought. What if you create a [`x86_64`](https://developer.android.com/ndk/guides/x86-64.html#over) folder in the `Assets/Plugins/Android` dir? Will this work? – Programmer Jan 26 '17 at 08:21
  • Thanks, Josh. Then, does **il2cpp** only work on **iOS** to build one for 64-bit architecture? – TwisTeDStRiDeR Jan 26 '17 at 15:04
  • @Programmer No, that will not make 64-bit plugins work on Android. They are simply not supported. – Josh Peterson Jan 27 '17 at 07:51
  • @TwisTeDStRiDeR No, on iOS both 32-bit and 64-bit are supported. By default, an iOS build with IL2CPP will create a universal binary with both architecture slices. – Josh Peterson Jan 27 '17 at 07:52