How to include a .bundle file in the resources folder when doing a extension [iOS]?

Hi everyone :smile:

iā€™m finishing up a UnityAds extension for OpenFL, i already have it working on android, but iā€™m having some problems with iOS. in this case, the test app i built crashes (not the build of the extension itself, that works perfectly) why is missing the UnityAds.bundle file with the following message in the xCode console:

   Please move the UnityAds.bundle into the Resource Directory of your Application!

i already tried using the tag <dependency> in the include.xml of the extension but doesnā€™t work. plus, i have <compilerflag value="-F../frameworks/"/> in the build.xml, where .framework and .bundle files are.

Any idea of how i can solve this?

Thanks !

I use a .bundle in an Mopub extension, all I had to do is manually adding the file in the Ressources folder in xcode. Didnā€™t find anyway to do it automaticaly with project.xml so youā€™ll have to do it every time you use update.

1 Like

buuu :frowning: well, i include it on the instructions then, if there is no other choice :sleepy:

Does it work if you copy it to the ā€œassetsā€ folder of the project, without modifying anything in Xcode?

i donā€™t have a assets folder in the extension ( the idea is to set something in the extension that would make available for the project that use it, like it does with .framework for example )

just for reference, even if you include the .bundle file in the assets folder in the final project, still doesnā€™t work. it must be drag and drop on Resources in xCode.

Didnā€™t work for me either.

My ressources files needs to be in the Resources folder, if I put them in assets they are in Resources/atssets , so the native lib iā€™m using doesnā€™t find its resources . In my case I could change the lib source code to change the path used, but there is other extension where you canā€™t change sources.

I think some of the comment in this issue are related : https://github.com/openfl/lime/issues/271 .

Iā€™m currently trying to do the changes the xcodeproj template and lime tools need so that the file in Resources and Classes folder are added to the project when using update, but I donā€™t know how ressources files ID work and get a corrupted .xcodeprojā€¦ Why would someone use such a complicated format to store project structure >.<

1 Like

I know, itā€™s ridiculous. I tried doing the same for the ā€œResourcesā€ folder, but I think I canā€™t let files copy to the ā€œResourcesā€ directory (maybe it doesnā€™t like Resources/Resources?) and instead these need to be manually added, one file at a time, to the generated Xcode project :frowning:

This is tough, though, because sometimes it seems like it treats certain things as localization strings, and therefore generates other code for itā€¦ itā€™s a little bit of a nightmare, but itā€™s probably not impossible :confused:

1 Like

I managed to include UnityAds.bundle during the build, this process worked for me : https://github.com/ipsilondev/openfl-unityads/issues/8

Thanks for this

Iā€™m interested in what we could do to automatically do this with our build tool