Android il2cpp build fail

Issue #25 resolved
Brahim Hadriche created an issue

When arkit plugin is in the project, build will fail for android il2cpp with the current error:

 In function `UnityARVideoFormat_EnumerateVideoFormats_m1076262586' : undefined reference to `EnumerateVideoFormats'

which is due to a "shim" function, which is only available for the editor. (so it should fail for any build that is il2cpp and not for iOS)

Fix:

in UnityARVideoFormat.cs:18

replace

        #if UNITY_EDITOR
        private static void EnumerateVideoFormats(VideoFormatEnumerator videoFormatEnumerator) {
        }
        #else
        [DllImport("__Internal")]
        private static extern void EnumerateVideoFormats(VideoFormatEnumerator videoFormatEnumerator);
        #endif

with

        #if UNITY_EDITOR || !UNITY_IOS
        private static void EnumerateVideoFormats(VideoFormatEnumerator videoFormatEnumerator) {
        }
        #else
        [DllImport("__Internal")]
        private static extern void EnumerateVideoFormats(VideoFormatEnumerator videoFormatEnumerator);
        #endif

Will create a PR asap, if not, anyone is free to do so and close this. Thanks

Comments (8)

  1. ezonecom

    Looks like the latest still fails when building on other platforms. Would you guys be able to test building on other platforms before you push another update? Right now it is pretty much impossible to use the same project for multiple platforms.

  2. Jimmy Alamparambil

    please consider moving to ARFoundation if you need multiplatform support. otherwise, also consider fixing this and contributing the changes back into the project. we don't have too many resources to handle every little use case of this plugin, that's why it is open source.

  3. Alain Birchmeier

    This actually resolved my problem. I'm porting an app from IOS to Windows Mixed Reality and had the same compilation error.

  4. Log in to comment