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

Unable To Build iOS App Using Native Extension

Community Beginner ,
Oct 08, 2014 Oct 08, 2014

Copy link to clipboard

Copied

I’m trying to create a native extension for iOS and use that extension as part of an IPA app for iOS I create from a SWF file using the ADT tool (i.e. the normal use-case for iOS). Note: I have already successfully created the native extension and APK app for Android and now I am trying to build the iOS side.

I have been primarily using the information found at the following websites:

http://www.adobe.com/devnet/air/articles/building-ane-ios-android-pt3.html

http://www.adobe.com/devnet/air/articles/building-ane-ios-android-pt5.html

http://help.adobe.com/en_US/air/build/WS901d38e593cd1bac35eb7b4e12cddc5fbbb-8000.html

I have also searched the Adobe forums for the answer to my question without success.

The error I receive is:

ld: warning: ignoring file /var/folders/c3/mpg4frwn2j1f8scw4jctbmv9hfkswj/T/bd3fbd4a-cf56-4fd6-a06d-d69ea92dc620/libcom.mycompany.MyExtension.a, file was built for archive which is not the architecture being linked (armv7): /var/folders/c3/mpg4frwn2j1f8scw4jctbmv9hfkswj/T/bd3fbd4a-cf56-4fd6-a06d-d69ea92dc620/libcom.mycompany.MyExtension.a

Undefined symbols for architecture armv7:

  "_MyExtensionInitializer", referenced from:

      _g_com_adobe_air_fre_fmap in aotInfo.o

  "_MyExtensionFinalizer", referenced from:

      _g_com_adobe_air_fre_fmap in aotInfo.o

ld: symbol(s) not found for architecture armv7

Compilation failed while executing : ld64

I receive the above error when I execute the following command:

adt -package -target ipa-ad-hoc -storetype pkcs12 -keystore certificate.pfx -provisioning-profile provisioning_profile.mobileprovision MyApp.ipa MyApp.xml MyApp.swf -extdir packaged-extensions

where the folder “packaged-extensions” contains the ANE file I created using this command:

adt -package -target ane packaged-extensions/MyExtension.ane MyExtension.xml -swc MyExtension.swc -platform Android-ARM -platformoptions platformAndroidARM.xml -C dependencies . -C platform/Android . -platform iPhone-ARM -platformoptions platformiOSARM.xml -C platform/IOS . -platform default -C platform/default library.swf

where the content of the files are as follows:

MyApp.xml:

<application xmlns="http://ns.adobe.com/air/application/4.0">

    <id>MyApp</id>

    <versionNumber>0.0.1</versionNumber>

    <filename>MyApp</filename>

    <initialWindow>

        <content>MyApp.swf</content>

        <visible>true</visible>

        <width>600</width>

        <height>600</height>

    </initialWindow>

    <supportedProfiles>mobileDevice</supportedProfiles>

        <extensions>

                <extensionID>com.mycompany.MyExtension</extensionID>

        </extensions>

</application>

MyExtension.xml:

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

        <id>com.mycompany.MyExtension</id>

        <versionNumber>0.0.1</versionNumber>

        <platforms>

                <platform name="Android-ARM">

                        <applicationDeployment>

                                <nativeLibrary>MyExtension.jar</nativeLibrary>

                                <initializer>com.mycompany.MyExtension</initializer>

                        </applicationDeployment>               

                </platform>

                <platform name="iPhone-ARM">

                        <applicationDeployment>

                                <nativeLibrary>libMyExtensionIOSLibrary.a</nativeLibrary>

                                <initializer>MyExtensionInitializer</initializer>

                                <finalizer>MyExtensionFinalizer</finalizer>

                        </applicationDeployment>

                </platform>

                <platform name="default">

                        <applicationDeployment/>

                </platform>

        </platforms>

</extension>

platformiOSARM.xml:

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

  <linkerOptions>

    <option>-ios_version_min 5.1</option>

    <option>-liconv</option>

  </linkerOptions>

</platform>

MyExtensionIOSLibrary.m (yes, I know it doesn't do anything - it's simple on purpose to help isolate the error):

#import "FlashRuntimeExtensions.h"

void MyContextInitializer(void* extData, const uint8_t *ctxType, FREContext ctx, uint32_t *numFunctionsToTest, const FRENamedFunction **functionsToSet) {

  return;   

}

void MyExtensionInitializer(void **extDataToSet, FREContextInitializer* ctxInitializerToSet, FREContextFinalizer* ctxFinalizerToSet) {

    *extDataToSet = NULL;

    *ctxInitializerToSet = &MyContextInitializer;

}

void MyExtensionFinalizer(void *extData)

{

    return;

}

I am using XCode to build MyExtensionIOSLibrary.m into a library file with a .a filename extension. My relevant build settings are:

iOS Deployment Target: iOS 5.1

Architectures: armv7

Build Active Architectures Only: No

Product Scheme: Release

Compile Sources As: Objective-C

Any ideas? Please help.

TOPICS
Development

Views

1.2K

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 ,
Oct 09, 2014 Oct 09, 2014

Copy link to clipboard

Copied

Hi,

That one sounds like a Xcode build settings problem.

Things to check:

- Base SDK: iphoneos

- Supported Platforms: iphoneos

- Valid Architectures: arm64 armv7 armv7s

- Other Linker Flags: -ObjC

- Automatic Reference Counting: YES

- Enable Linking With Shared Libraries: YES

Cheers   

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
Community Beginner ,
Oct 14, 2014 Oct 14, 2014

Copy link to clipboard

Copied

Thanks so much for your response! I checked all of those settings and they're all already as you suggested. So I guess it's something else.

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
New Here ,
Oct 15, 2014 Oct 15, 2014

Copy link to clipboard

Copied

same error here.have you solved the problem?

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 ,
Oct 15, 2014 Oct 15, 2014

Copy link to clipboard

Copied

Yeah okay,

How are you building the iOS library (.a) ? Are you compiling for a device and pulling the file out of Release-iphoneos/

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
New Here ,
Oct 15, 2014 Oct 15, 2014

Copy link to clipboard

Copied

LATEST

Thanks for the reply.

yes.I've created a static library with 3rd party frameworks and pulled the .a from product folder(Debug-iphoneos).

and the framework didn't work(armv7 not supported error occurs ..don't know why) with it's original folder structure .

so I followed below link to change folders inside the 3rd party framework and figured out but now  the application crashes on startup without giving an error message. .

スタッフ日記 - 【ANE作成】外部フレームワーク を含むANE作成時の注意点(iOS) | 株式会社マリエッタ

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