Search code examples
androidiosunity-game-enginebuildartoolkit

Build iOS and Android ARToolkit wrappers (ARWrapper) libraries for Unity 3D


I have been trying for a while to figure out how to build the ARWrapper library that is used by Unity to interface to ARToolkit 5.3.1. I can build the ARWrapper bundle using the ARToolkit source but I have no idea how to move from the bundle to the platform specific libraries (iOS and Android). In ARToolkit package for Unity there are the following assets provided which I need to build:

Android: AndroidManifest.xml, AndroidManifest.xml.meta, BT200Ctrl.jar, BT200Ctrl.jar.meta, libARWrapper.so, libARWrapper.so.meta, libc++_shared.so, libc++_shared.so.meta, res: res.meta, UnityARPlayer.jar, UnityARPlayer.jar.meta

iOS: ARToolKitUtilities.m, ARToolKitUtilities.m.meta, libARWrapper.a, libARWrapper.a.meta, libjpeg.a, libjpeg.a.meta

But so far using ARToolkit source code I could only build one bundle file (ARWrapper.bundle).

Could someone please help me understand how to move from the bundle to platform specific libraries as shown above in the asset folder of the package. More specifically I want to be able to build libARWrapper.so and libARWrapper.a


Solution

  • libARWrapper is part of ARToolKit for each platform.

    • You already built it for OS X, presumably using the ARToolKit for OS X SDK.
    • To build it for iOS, you'll need to download the ARToolKit for iOS SDK and build in Xcode, then copy libARWrapper.a from libs into your Unity project.
    • For Android, again, download the ARToolKit for Android SDK, open a terminal window, cd android and then ./build.sh. Finally, copy the libARWrapper.so from the libs directory into your Unity project.
    • For Windows Win32, download ARToolKit for Windows SDK, do build, copy ARWrapper.dll from the bin directory into your Unity project.

    The other portions you mentioned can generally be rebuilt on each platform. For Android, the other key component you might want to rebuild is UnityARWrapper.jar, the source for which is included in the ARToolKit for Unity SDK.