Copy link to clipboard
Copied
Hi!
I've been struggling with creating ANE for iOS for a week. The problem is that we have our own custom iOS framework with resources.
Mostly my work was based on this article: Adobe Flash Platform * Building the native library
I've tried a lot of things trying to integrated it into the ANE and came up with the following restrictions, please correct me if I wrong.
1. Dynamic custom iOS frameworks that are supported in iOS 8 don't work. Or I didn't found a way to link them appropriately. So you have to make a static library inside a framework. I tried some options like placing framework at different places inside an IPA and configuring @rpath, but didn't succeed.
2. Assets in custom embedded frameworks are ignored. When you embed a custom framework using platformoptions/packagedDependency like in example in article:
<packagedDependencies>
<packagedDependency>SampleFramework.framework</packagedDependency>
</packagedDependencies>
The framework in this case will be linked with target application, but in final ipa file you'll not find the assets from it.
This means that you have to put them separately into the root folder with prefixes to make them unique. This described with more details here: Adobe Flash Platform * Including resources in your native extension package
Also there is a good example of ANE with custom framework (but i guess it still have a problem with assets): freshplanet/ANE-Facebook · GitHub
I hope that someone will save time.
Copy link to clipboard
Copied
I was trying to do the same thing, and thought I'd share even though this post is old.
1. Couldn't get dynamic framework working, went with static.
2. We put the static framework in the packagedDependencies tag just like the OP did.
3. We also had problems with assets, so we followed this: Adobe Flash Platform * Including resources in your native extension package
We put the assets in the iPhone-ARM directory in the ANE, and they do get copied to the root directory of the IPA. We have been able to use storyboards, images, etc stored in the custom framework without problems. Since assets from EVERY ANE get copied to the top level of the IPA, yes, we did have to change asset names to avoid conflicts. Annoying but doable.
I'm probably missing some details of how we did it but I at least wanted to share that after much pain and Googling, we did get a custom framework in an ANE to work, even on iOS7.
Copy link to clipboard
Copied
Hello guys,
we had to get dynamic libs working in our app, so we finally found a way to do this. It is a bit weird but well it works
You have to add the .frameworks in the final app in the /Frameworks directory.
1. You have to sign the dynamic Frameworks with your entitlements.
security find-identity -v -p codesigning
codesign --sign "###HASH WHICH YOU GET FROM THE LIST###" --force --all --option=library path/to/your/Framework.framework/
codesign -vv -d "path/to/your/Framework.framework/"
After that we hit a block because Adobe signs the ipa without a Team Identifier ... which you can see wenn you unzip the ipa and check it with:
codesign -dvvv Payload/appname.app/
So you have to re-sign your .ipa to get the Team Identifier inside, there are two ways:
I hope I could help you with the stuff.
Cheers
Copy link to clipboard
Copied
I'm having one hell of a time trying to add a dynamic framework to an ANE. Can't you code sign all in Xcode and set the team? I'm using flash builder and using a generic .p12 to sign the app. I'm debugging for now.
I keep getting this error when debugging which you might have seen before. I haven't code sign, maybe I'll get the framework code sign to 'developer' and set a 'team' in Xcode to see if it makes a difference.
ld: library not found for -lSystem.B
ld: library not found for -lgcc_s.1
Compilation failed while executing : ld64
Copy link to clipboard
Copied
I have never gotten a custom dynamic framework to work in an ANE, only a
static one.
--
Thanks,
Kawika Heftel
Heftel Studios
801-358-9830
http://www.heftelstudios.com
Copy link to clipboard
Copied
Have you tried recently? Dynamic Framework was supported on iOS until recently, iOS 8.x.
Copy link to clipboard
Copied
It's been several months since I tried. Like you, I hit many dead ends. Why do you need dynamic btw? Static works great for us, and we have about 4 games in the app store that have ANEs with embedded images, sounds, native storyboards, viewcontrollers, coredata databases, etc, all available to the native code part of the ANE.
Also, our apps support ios 7.0, so that rules out dynamic even if I could get the IPA to compile (which I never did, after days of tearing my hair out). Since static works perfectly for me, I'm no longer interested in further wall-head-banging .
Copy link to clipboard
Copied
Also, not all of our assets are in the root folder, we were able to get subfolders for assets to work in the ANE.
Copy link to clipboard
Copied
‌Swift can only be made into dynamic framework Sadly.
Copy link to clipboard
Copied
ah, there's the rub. That is unfortunate! Dylibs (both user-generated and system) work great on the Mac OSX platform, and many system libraries on iOS are dylibs, but support for user-generated dylibs has been sadly lacking on iOS. Hopefully iOS 9 will change that (I'm not counting on it)? We were using Obj-C so when we hit the walls you hit, we were free to switch to static.
Best of luck to you!
Copy link to clipboard
Copied
iOS 8.x+ does support dynamic frameworks but I think AIR needs to catch up.
I was confident it would work but seems like AIR doesn't support it.
Copy link to clipboard
Copied
That is also a possibility. However, in my research into it (6 months ago maybe?) I seem to remember reading about people having problems with dynamic frameworks even in all-native apps. However, my information isn't current, so take it with a grain of salt....
Copy link to clipboard
Copied
Uggh, I've tried everything. Hitting dead ends. The guys at abode needs to make a tutorial. There are so many parts, it's hard to tell what went wrong.