1 Reply Latest reply on Sep 17, 2017 10:00 PM by dews

    @available in XCode causes Undefined symbols error

    dews Level 1

      ANE on the iOS side - if I include the condition in my XCode functions:

       

      if (@available(iOS 11.0, *))

      {

       

      }

       

      I am able to build the ANE, however, my project won't run - it fails with:

       

      Undefined symbols for architecture arm64:

        "___isOSVersionAtLeast", referenced from:

      .......and list of the functions that include the conditional statement......

       

      Undefined symbols for architecture armv7:

        "___isOSVersionAtLeast", referenced from:

      .......and list of the functions that include the conditional statement......

       

       

      If I comment out the condition everything works as expected.

       

      I can't figure out what I need to include either when building the static library in XCode or when building the ANE..?

       

      Any help much appreciated.

        • 1. Re: @available in XCode causes Undefined symbols error
          dews Level 1

          Not marking this as answered because we should be able to use the new feature available in XCode 9: if (@available(iOS 11.0, *)) which of course also suppresses any potential warnings.

           

          This is the workaround - add in your header:

           

          #define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)

           

          Then in your files that you need to check for version:

           

          #import "UIKit/UIKit.h"

           

          In the methods:

           

           

          if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"11.0"))

          {

          ..........