IronSource SDK native extension

@marat.giliazov How do you integrate other networks as part of the mediation?
I understand I need to integrate other SDKs, but how to link them ironsource?
Is there any example available for this?

I’m trying to integrate Facebook Ads through mediation.

Here is the extension grade file

repositories {
	// https://developers.ironsrc.com/ironsource-mobile/android/android-sdk/#step-1
    maven {
        url "https://dl.bintray.com/ironsource-mobile/android-sdk"
    }
    maven {
        url  "https://android-sdk.is.com/"
    }
}

dependencies {
	// https://developers.ironsrc.com/ironsource-mobile/android/android-sdk/#step-1
    implementation 'com.ironsource.sdk:mediationsdk:6.15.0@jar' 
    implementation 'com.facebook.android:audience-network-sdk:6.4.0'
}

The build fails when merging manifest:

SEVERE: /tmp/.gradle/unpacked/com.facebook.android-audience-network-sdk-6.4.0.aar/AndroidManifest.xml:12:9-55 Error:
	Missing 'package' key attribute on element package at AndroidManifest.xml:12:9-55
May 13, 2021 9:05:13 AM com.defold.manifestmergetool.ManifestMergeTool$ILoggerWrapper error
SEVERE: /tmp/.gradle/unpacked/com.facebook.android-audience-network-sdk-6.4.0.aar/AndroidManifest.xml Error:
	Validation failed, exiting
May 13, 2021 9:05:13 AM com.defold.manifestmergetool.ManifestMergeTool$ILoggerWrapper warning
WARNING:
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.

May 13, 2021 9:05:13 AM com.defold.manifestmergetool.ManifestMergeTool main
SEVERE: java.lang.RuntimeException: Failed to merge manifests: com.android.manifmerger.MergingReport@6c49835d

I seem to be missing something. Can anyone help?

This sounds familiar. It could be related to the version of the Android build tools or something like that. Which version of Defold are you using?

Yep, it seems to be the case:

Please let us know which version of Defold you are using!

I’m using 1.2.180.

Here’s a forum post with a user experiencing the same thing: Several Android-specific questions, while integrating Ads Mediation (15+ networks)

I believe the problem is that we are using an old version of the manifest merge tool from Google. We use version 26.0.0:

But there are newer versions available:

https://mvnrepository.com/artifact/com.android.tools.build/manifest-merger?repo=google

I’ve created a ticket to track this issue: https://github.com/defold/extender/issues/198

1 Like

Thanks for looking into it. Is there any temporary work around we can use?

The only thing I can think of is to use an older version of dependencies or that you set up a local build server.

But I’ll try to take a look at this next week!

Looking into this now!

1 Like

PR: Updated to newer version of the Android manifest merge tool by britzl · Pull Request #199 · defold/extender · GitHub

Great news, monetisation here I come $$$ :grinning:

Does that mean I need to run my own build server for this patch to be taken into account?

Or is it already deployed on Defold official build server? I don’t see how I can see which version is on the Defold servers. A bit confused about how that works under the hood.

The beta (stage) server is located at https://build-stage.defold.com/, and the sha1 there is the commit sha of the beta branch in the extender repo. Same goes for https://build.defold.com/

The fix has not yet been merged to extender/beta yet.

OK thanks for the explanation.
Any estimated time on when you will merge the latest patch?

I just updated the beta server with support for the latest manifest merging tool.
Use https://build-stage.defold.com as your build server.

3 Likes

I’m experiencing problem with IronSource on iOS.
Once I add the IronSource Defold SDK to the project, my app crashes at startup with the following logs:

Attempt to add an app with insufficient id, info {
    BKSApplicationStateAppIsFrontmost = 1;
    BKSApplicationStateExtensionKey = 0;
    SBApplicationStateDisplayIDKey = "com.example.todo";
    SBApplicationStateKey = 8;
    SBApplicationStateProcessIDKey = 591;
    SBApplicationStateRunningReasonsKey =     (
                {
            SBApplicationStateRunningReasonAssertionIdentifierKey = UIApplicationLaunch;
            SBApplicationStateRunningReasonAssertionReasonKey = 10000;
        }
    );
    SBMostElevatedStateForProcessID = 8;
}

I’m really struggling to understand what’s going on. I use the latest Ironsource Defold SDK and defold 1.2.184

The log doesn’t say much. Aren’t you getting a proper stack trace?

At the moment every time I click on “View Device Logs”, my Xcode crashes which is very annoying to dig into the logs… I manage to get the following logs in the console.

19:53:52.773439+0200	default	SpringBoard	Bootstrapping com.goldengoose.test with intent foreground-interactive
19:53:52.775521+0200	error	SpringBoard	[com.goldengoose.test] Bootstrap failed with error: <NSError: 0x2826ba100; domain: BKSProcessErrorDomain; code: 1 (bootstrap-failed); reason: "Failed to start job">
19:53:52.775747+0200	error	SpringBoard	Bootstrapping failed for <FBApplicationProcess: 0x151439a20; com.goldengoose.test; pid: -1> with error: Error Domain=BKSProcessErrorDomain Code=1 "Unable to bootstrap process with bundleID com.goldengoose.test" UserInfo={NSLocalizedDescription=Unable to bootstrap process with bundleID com.goldengoose.test, BKSProcessExitReason=0, NSLocalizedFailureReason=Failed to start job, NSUnderlyingError=0x2826b8330 {Error Domain=NSPOSIXErrorDomain Code=3 "No such process" UserInfo={BKLaunchdOperation=launch_get_running_pid_4SB, NSLocalizedDescription=Unable to get pid for label UIKitApplication:com.goldengoose.test[0x3011][62], BKLaunchdJobLabel=UIKitApplication:com.goldengoose.test[0x3011][62], NSLocalizedFailureReason=No such process}}, BKSProcessJobLabel=UIKitApplication:com.goldengoose.test[0x3011][62], BSErrorCodeDescription=bootstrap-failed}
19:53:52.775846+0200	default	SpringBoard	Adding: <FBApplicationProcess: 0x151439a20; com.goldengoose.test; pid: -1>
19:53:52.775943+0200	default	SpringBoard	<FBApplicationProcess: 0x151439a20; com.goldengoose.test; pid: -1> exited.
19:53:52.778359+0200	error	SpringBoard	[FBScene] Scene with ID "com.goldengoose.test" got nil client from provider <private>
19:53:52.778592+0200	default	SpringBoard	Removing: <FBApplicationProcess: 0x151439a20; com.goldengoose.test; pid: -1>
19:53:52.778649+0200	default	assertiond	Submitting new job for "com.goldengoose.test" on behalf of <BKProcess: 0x100f11a60; SpringBoard; com.apple.springboard; pid: 52; agency: SystemShell; visibility: foreground; task: running>
19:53:52.778748+0200	default	assertiond	Submitted job with label: UIKitApplication:com.goldengoose.test[0x3011][62]
19:53:52.778817+0200	default	assertiond	Unable to get pid for 'UIKitApplication:com.goldengoose.test[0x3011][62]': No such process (3)
19:53:52.778863+0200	default	SpringBoard	[com.goldengoose.test] Setting deactivation reasons to: 'systemAnimation' for reason: scene settings update - settings are eligible for deactivation reasons.
19:53:52.778917+0200	error	assertiond	Failed to start job with error <NSError: 0x100f42740; domain: NSPOSIXErrorDomain; code: 3; reason: "No such process"> {
    description = "Unable to get pid for label UIKitApplication:com.goldengoose.test[0x3011][62]";
    failureReason = "No such process";
    userInfo = {
        BKLaunchdJobLabel = UIKitApplication:com.goldengoose.test[0x3011][62];
        BKLaunchdOperation = launch_get_running_pid_4SB;
    }
}
19:53:52.820688+0200	default	SpringBoard	Application process state changed for com.goldengoose.test: <SBApplicationProcessState: 0x282b57020; pid: -1; taskState: Not Running; visibility: Unknown>
19:53:52.820820+0200	default	SpringBoard	Process exited: <FBApplicationProcess: 0x151439a20; com.goldengoose.test; pid: -1> -> <FBApplicationProcessExitContext: 0x2826a1d70; exitReason: (none); terminationReason: (none)> {
    stateAtExit = <FBProcessState: 0x282b53100; pid: -1; taskState: Unknown; visibility: Unknown>;
}

I just uploaded the test project I’m using: https://fructozeapp.ams3.digitaloceanspaces.com/def_ironsource-master%202.zip
You just need to replace the Bundle identifier in game.project to run it on your machine.

Basically without the Ironsource dependency: app works fine.
If I add the dependency: crash at startup.

I’m running iOS 12.3 by the way.

Actually, even the canonical project https://github.com/MaratGilyazov/def_ironsource/archive/refs/tags/1.2.zip. crashes at startup.

I’m using iOS 12.3

@marat.giliazov Which version of iOS have you tested with? Any pointer on what could cause this crash?