• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

@available in XCode causes Undefined symbols error

Engaged ,
Sep 17, 2017 Sep 17, 2017

Copy link to clipboard

Copied

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.

TOPICS
Air beta

Views

8.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Sep 17, 2017 Sep 17, 2017

Copy link to clipboard

Copied

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"))

{

..........

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jan 10, 2018 Jan 10, 2018

Copy link to clipboard

Copied

We've run into this issue too and it's a pain because this is starting to appear in 3rd party library code. Have you made a bug report? if so I'll vote on it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jan 10, 2018 Jan 10, 2018

Copy link to clipboard

Copied

I didn't submit a bug report actually - you're right of course I should have done so back in September.

Just fyi, not currently in a position to do so - so if you happen to file one b4 I'm able - I'll of course vote on yours.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jan 11, 2018 Jan 11, 2018

Copy link to clipboard

Copied

Tracker <= this bug on the tracker

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 31, 2018 May 31, 2018

Copy link to clipboard

Copied

Just an FYI for anyone attempting to get around this, we've added a few additions to the distriqt Core ANE that implements the required functionality to get the @available flag working.

Simply by including the Core ANE in your application you should be able to use any ANE that uses the @available flag.

It's available here: GitHub - distriqt/ANE-Core: ANE providing a centralised notification / delegation system

air native extensions // https://airnativeextensions.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 05, 2018 Jun 05, 2018

Copy link to clipboard

Copied

To do this without using a custom DEFINE ( or to use closed source Frameworks which use @available such as latest Firebase )

1. Copy this file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.1.0/lib/darwin/libclang_rt.ios.a

to

[AIRSDK_PATH]/lib/aot/lib/libclang_rt.ios.a

2. Add this to your linkerOptions in platform.xml

<linkerOptions>

  <option>-lclang_rt.ios</option>

</linkerOptions>

= Happy Days

Amrita Gangwani

Hopefully Adobe can add libclang_rt.ios.a to AIR SDK dist ?

*Credit to Eugene Petrenko @JetBrains

https://jonnyzzz.com/blog/2018/06/05/link-error-2/

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jun 05, 2018 Jun 05, 2018

Copy link to clipboard

Copied

Hi,

Thank You for reporting the issue!

Since the @available API has been made available since iOS 11, make sure that you are packaging the ANE for iOS version 11. You can do so by setting linkerOptions and sdkVersion in your platform.xml for packaging ANE. Below is a sample platform.xml for doing so:

<platform xmlns="http://ns.adobe.com/air/extension/30.0">

      <sdkVersion>11.0.0</sdkVersion>

      <linkerOptions>

          <option>-ios_version_min 11.0</option>

      </linkerOptions>

</platform>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 05, 2018 Jun 05, 2018

Copy link to clipboard

Copied

Hi, That's not quite correct. @available was introduced with Xcode 9 but it still works on older versions of iOS.

air native extensions // https://airnativeextensions.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jun 05, 2018 Jun 05, 2018

Copy link to clipboard

Copied

Hi Michael,

Please give it try by setting the iOS Deployment Target set as 11.0 in the Xcode and share your feedback.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 06, 2018 Jun 06, 2018

Copy link to clipboard

Copied

Sorry but that's not really a solution as the @available flag can be used in a third party framework and setting the deployment target that high will reduce the number of devices we can support with native extensions.

air native extensions // https://airnativeextensions.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jun 07, 2018 Jun 07, 2018

Copy link to clipboard

Copied

Hi Michael,

Please log a bug at Tracker.

We would be looking into it in the upcoming releases.

Thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jun 08, 2018 Jun 08, 2018

Copy link to clipboard

Copied

This bug has been logged already for months, 17 votes woohoo
https://tracker.adobe.com/#/view/AIR-4198557

Tracker

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Mar 14, 2019 Mar 14, 2019

Copy link to clipboard

Copied

LATEST

Any news? It is still not possible to compile the latest Facebook SDK (for example Distriqt ANE) with Air 32.0.0.103 on Windows because of the bug logged in the issue tracker.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines