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

How to package .json files for use in an ANE for iOS

Community Beginner ,
Nov 24, 2014 Nov 24, 2014

Copy link to clipboard

Copied

I am creating an Adobe Native Extension (ANE) for use with iOS. The native code in the main .a library file used for the ANE depends on 3rd party frameworks which themselves depend on the definitions of JSON objects defined in several .json files. I can package the 3rd party frameworks with the ANE just fine - it's the .json files that I'm having difficulties with.

I've tried packaging the .json files into the main .a library file, although I don't know if I did it the right way.

Please help.

TOPICS
Development

Views

1.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
Contributor ,
Dec 03, 2014 Dec 03, 2014

Copy link to clipboard

Copied

Not sure how you're supposed to pass those JSON strings(if as filenames or as strings read from files). If as strings, you might just paste them into native source code?  Or maybe just distribute the .json file(s) separately outside of your ANE and instruct people to include them when publishing to iOS (like they would include external mp3's or whatever else). Then hopefully you could read those files from inside your ANE (checking if they are available first, if not you can throw a nice exception telling people to upload those).

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 ,
Dec 03, 2014 Dec 03, 2014

Copy link to clipboard

Copied

You can read through the resources documentation for iOS here:

http://help.adobe.com/en_US/air/extensions/WSf268776665d7970d-2e74ffb4130044f3619-7ff8.html

Of particular interest is the line:

"3. It moves the resource files to the top-level directory of the application."

So not sure if you are using an ant build script or whatever to build your ANE, but as long as you place these json files into the folder with your library when you build the ANE, these will end up getting copied to the top-level directory of the application when an application is built using this ANE.

This is exactly how I include an iOS .bundle of resources along with a .a in an ANE and it works fine. Nice clean packaging when distributing the ANE too.

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
Explorer ,
Jun 28, 2018 Jun 28, 2018

Copy link to clipboard

Copied

This old post saved my day

I was looking for a way to include iOS .bundle file in my ANE...

Thank you so much !

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 ,
Jul 08, 2018 Jul 08, 2018

Copy link to clipboard

Copied

fmontfort974

I consistently get APIInternalError when deploying my final AIR app to iOS device when I try to include 3rd party .bundle files as part of the ANE. Are you seeing similar ?

The way I do it at the moment is to package the .bundle(s) when building my app, but would like to do include with the ANE.

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
Explorer ,
Jul 08, 2018 Jul 08, 2018

Copy link to clipboard

Copied

el111

I had a lot of difficulty with this problem (embedding .bundle and other ressources in an ANE).

In reading several documentation and this post, I realized that it is finally pretty easy to integrate in the final package a ".bundle".

Just copy it to the "build/ios" directory with library.swf and any other file you want to add to the compiled ANE (images, sounds, videos...), and that's 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 ,
Jul 10, 2018 Jul 10, 2018

Copy link to clipboard

Copied

LATEST

Thanks for the info.

I am able to package the .bundle with the ANE.

When the app builds the .bundle is successfully added in the root of the ipa file (can see it when I unzip)

However the app throws up the error when I try and install on device. It may be a signing issue or something to do with the bundleId.

I will dig further and look to diff the plist, certs etc between the version that installs and that which doesn't.

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