Issues with building native extension with 100mb+ files inside (SOLVED)

Hi, I’m trying to add AppLovin ad network adapter to my IronSource native extension on iOS.

There are two issues,
First and minor - their ISApplovinAdapter file is bigger than 100mb, so github does not let to push it as is and when I put it Under LFS it seems also not working smoothly with Defold,

  1. download .zip directly by https://github.com/MaratGilyazov/def_ironsource/archive/mediation/applovin.zip
  2. look at /def_ironsource-mediation-applovin/ironsource/lib/ios/ISAppLovinAdapter.framework/ISApplovinAdapter file size - 134 bytes
  3. compare with the original https://github.com/MaratGilyazov/def_ironsource/blob/mediation/applovin/ironsource/lib/ios/ISAppLovinAdapter.framework/ISApplovinAdapter - 106 mb under LFS

If try to build with such extension set in project dependencies as a link to the github, build fails with:

ld: framework not found ISAppLovinAdapter

So it’s impossible to use such extension via github, but OK, it’s not REQUIRED to be used exactly through github, right?

But when I try to store everything locally, there is still a problem, the major one for me right now.
Steps to repro:

ld: framework not found ISAppLovinAdapter

I don’t know if something is broken in the Adapter, if I am doing something wrong or if there some issue with Defold ignoring such big 100mb+ files. But the same steps worked with Admob, UnityAds and Vungle adapters.

My experience is not enough to solve this :frowning:

P.S. here is Applovin adapter integration guide from IronSource, nothing special imo: https://developers.ironsrc.com/ironsource-mobile/ios/applovin-mediation-guide/

Well, to start with it is 100mb. I’d say that is pretty broken :slight_smile: I wonder what it contains?

As I understand, it includes Applovin SDK. For some other networks you need both “IronSource adapter” + “network sdk”, for other like Applovin and Vungle, they wrapped the ad network SDK into their adapter. And yes, Applovin SDK downloaded from official repo weights 85mb+ itself and other networks are 25, 50, 80 mb. Don’t know what’s inside, but that’s the reality.

Is there any limits on Defold-side for files in Native extension? As I remember NEs are built on Defold’s servers, so it means uploading and downloading files… on each build?..

We have a max upload limit of 500mb.
If you hit that, it should tell you.

The size of the framework could be that it contains many architectures. Try removing those you don’t need, and putting the ones you need in separate files. Use the ’lipo’ tool for that.

As for why it doesn’t build, I’ll have to try it myself to see if I can figure it out.

2 Likes
mathiaswesterdahl ~/work/projects/users/marat/def_ironsource-mediation-applovin  NO DYNAMO_HOME! 
$ file ironsource/lib/ios/IronSource.framework/IronSource 
ironsource/lib/ios/IronSource.framework/IronSource: Mach-O universal binary with 4 architectures: [arm_v7:current ar archive] [arm64]
ironsource/lib/ios/IronSource.framework/IronSource (for architecture armv7):	current ar archive
ironsource/lib/ios/IronSource.framework/IronSource (for architecture i386):	current ar archive
ironsource/lib/ios/IronSource.framework/IronSource (for architecture x86_64):	current ar archive
ironsource/lib/ios/IronSource.framework/IronSource (for architecture arm64):	current ar archive

Same with the ISAppLovingAdapter:

mathiaswesterdahl ~/work/projects/users/marat/def_ironsource-mediation-applovin  NO DYNAMO_HOME! 
$ file ISApplovinAdapter 
ISApplovinAdapter: Mach-O universal binary with 4 architectures: [arm_v7:current ar archive] [arm64]
ISApplovinAdapter (for architecture armv7):	current ar archive
ISApplovinAdapter (for architecture i386):	current ar archive
ISApplovinAdapter (for architecture x86_64):	current ar archive
ISApplovinAdapter (for architecture arm64):	current ar archive

The ld: framework not found ISAppLovinAdapter means you need that library (framework) to link the executable. So you need to add that too to your extension.

mathiaswesterdahl ~/work/projects/users/marat/def_ironsource-mediation-applovin  NO DYNAMO_HOME! 
$ ls -la ./ironsource/lib/ios/ISAppLovinAdapter.framework/ISApplovinAdapter
-rw-r--r--  1 mathiaswesterdahl  staff  134 Mar  2 19:03 ./ironsource/lib/ios/ISAppLovinAdapter.framework/ISApplovinAdapter

mathiaswesterdahl ~/work/projects/users/marat/def_ironsource-mediation-applovin  NO DYNAMO_HOME! 
$ file ./ironsource/lib/ios/ISAppLovinAdapter.framework/ISApplovinAdapter
./ironsource/lib/ios/ISAppLovinAdapter.framework/ISApplovinAdapter: ASCII text

mathiaswesterdahl ~/work/projects/users/marat/def_ironsource-mediation-applovin  NO DYNAMO_HOME! 
$ cat ./ironsource/lib/ios/ISAppLovinAdapter.framework/ISApplovinAdapter
version https://git-lfs.github.com/spec/v1
oid sha256:7dfb496cfa0811bc2de0c8656acc42bdfd23e549904cdb27c0fcb613a44e4537
size 110914936

As you see, the contents of that file (as you see, only 134 bytes), is plain ascii text, containing the version of the file you references. I advice you to download the framework manually, or copy it from a cloned repo on your hard drive.

1 Like

The ld: framework not found ISAppLovinAdapter means you need that library (framework) to link the executable. So you need to add that too to your extension.

Thanks for investigation, but I’m afraid I don’t understand what you mean. Add what to my extension? Putting “.framework” (with ISAppLovinAdapter inside it) under “extension_name/lib/ios/” is not enough? Should I mention ISAppLovinAdapter in ext.manifest somehow or what? But why it worked with all other “.framework” libs and with theIronSurce.framework itself without any additional steps?

I believe that’s how LFS works, storing only the actual version of the file to be downloaded, that’s ok, I’ll store the whole extension as a plain folder in the project instead of linking via github, not a real problem.

The main issue is this “framework not found” error, even when everything is stored locally.

PUtting it there is enough, but it depends on what you put there :slight_smile:

In this case, that file it’s just a text file, not an actual library.

Well, the library you’ve stored there is not an actual library (it’s a text file), so I can understand that the c++ linker complains about that the framework is missing.

No no no no no, I’m putting the EXACT 110mb file here. The issue with LFS and impossibility to use the github linking in dependency in such case is only the minor thing. Sorry if I was uncler, but that’s what I’m facing:

  • ironsource extension as a plain folder, no github links involved
  • download the “ISAppLovinAdapter.framework” from the official storage, with the whole 110 mb library and other stuff
  • put the “.framework” under “/lib/ios/”
  • build
  • get the error: ld: framework not found ISAppLovinAdapter

That’s the main problem. I don’t understand why it can’t be found when it’s here and if any additional configurations are required. (and my first assumption was, that Defold simply does not upload it when compiling the extension, but you said the limit is 500mb)

This part from the initial message:

Steps to repro:

  1. I downloaded your https://github.com/MaratGilyazov/def_ironsource/archive/mediation/applovin.zip

  2. I unpacked it

  3. I checked the type of the files:

mathiaswesterdahl ~/work/projects/users/marat/def_ironsource-mediation-applovin  NO DYNAMO_HOME! 
$ file ironsource/lib/ios/IronSource.framework/IronSource 
ironsource/lib/ios/IronSource.framework/IronSource: Mach-O universal binary with 4 architectures: [arm_v7:current ar archive] [arm64]
ironsource/lib/ios/IronSource.framework/IronSource (for architecture armv7):	current ar archive
ironsource/lib/ios/IronSource.framework/IronSource (for architecture i386):	current ar archive
ironsource/lib/ios/IronSource.framework/IronSource (for architecture x86_64):	current ar archive
ironsource/lib/ios/IronSource.framework/IronSource (for architecture arm64):	current ar archive

mathiaswesterdahl ~/work/projects/users/marat/def_ironsource-mediation-applovin  NO DYNAMO_HOME! 
$ file ironsource/lib/ios/ISAppLovinAdapter.framework/ISApplovinAdapter 
ironsource/lib/ios/ISAppLovinAdapter.framework/ISApplovinAdapter: ASCII text

This clearly shows that the second file is an ascii text file, not a library file.

Yes, and that’s the issue (1), the minor one. Just to point, that it’s impossible to work with the native extensions containing big files being linked as a dependency in game.project via github. That’s not a major problem (but still is a pain)

After pointing to it there is explanations, that even when I load and put everything correctly (well, at least it looks correct), it does not work.

Yes, sorry, I started with the first issue in the post.
I’ll debug your last issue now…

1 Like

It’s a typo, the framework isn’t named exactly the same as the library.

ISAppLovinAdapter != ISApplovinAdapter

It’s important since we build on Linux which has case sensitive paths (OSX/Windows does not)
Hence the apt error message, it couldn’t find it :slight_smile:

Solution:

$ mv ironsource/lib/ios/ISAppLovinAdapter.framework/ISApplovinAdapter ironsource/lib/ios/ISAppLovinAdapter.framework/ISAppLovinAdapter 
2 Likes

OMG o___O

I’d never notice this, thanks so much for checking! :handshake:

2 Likes