Conflict between AppsFlyer and Vungle plugins

I’m trying to integrate AppsFlyer and when I do a build for Amazon with the Vungle plugin enabled the build fails (Error 256), and I get the following error message:

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:App:processReleaseManifest’.

Manifest merger failed : Attribute application@fullBackupContent value=(@xml/vungle_backup_rule) from [com.vungle:publisher-sdk-android:6.3.24] AndroidManifest.xml:16:9-60
is also present at [com.appsflyer:af-android-sdk:5.2.0] AndroidManifest.xml:14:18-73 value=(@xml/appsflyer_backup_rules).
Suggestion: add ‘tools:replace=“android:fullBackupContent”’ to element at AndroidManifest.xml:25:2-86:19 to override.

I see that there’s a suggestion there, but I don’t know what it means or how to implement it.

If I remove either Vungle or AppsFlyer from build.settings, the build works just fine. It’s only when both are present that the build fails. I’m using Solar2D build 3604 and java version 1.8.0_231.

If anyone who understands what’s going on under the hood can offer me any insight, I’d really appreciate it. Thanks!

I am going to have to give away one of my super secrets to help you. But I am always in a giving mood so here is what to do:

  1. In the root of your project if you don’t have a one create a folder called AndroidResources.
  2. In that folder create a file called AndroidManifest.xml
  3. In that file copy and paste this:
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android" tools:replace="android:fullBackupContent"></manifest>

PS: Not really a secret you just have to understand how android builds work.

2 Likes

@agramonte Thank you so much for sharing your secrets with me!

I hope your giving mood continues, because I just noticed that the suggestion given in the error message didn’t copy/paste correctly in my original post. Above, it says:

However, the tag <application> doesn’t show up because the forum text editor thought it was a markup tag. It should be:

Suggestion: add 'tools:replace="android:fullBackupContent"' to <application> element at AndroidManifest.xml:25:2-86:19 to override.

(I was having a hard time getting the error message to paste in properly and was getting all kinds of formatting issues.)

Sufficed to say, your suggested fix does not work because I gave you bad information. I looked at the Solar2D doc regarding the manifest and flailed around for a while, but nothing I tried worked.

Knowing that ‘tools:replace’ is supposed to go in the <application> element, do you have another fix for me?

Thank you for your time- I appreciate it! :grinning:

Before I wrote the post, I did a test project to make sure it would work. I will try to find and it send it to you.

That would be fantastic! I put the chance at “pretty high” that I’ve just made a dumb mistake…

I realized between testing out and writing the response that I missed out on many steps I took to get this to work. Please find a working solution attached.
appsfly-vungle.zip (502.1 KB)

1 Like

Thank you for the file- I’m very grateful for your time and effort to this problem.

I noticed that the file you uploaded doesn’t use the AppsFlyer plugin:

--
-- Plugins section
--
plugins =
{
	["plugin.vungle"] = {
        publisherId = "com.vungle",
    },
	["shared.google.play.services.ads.identifier"] = {
        publisherId = "com.coronalabs",
    },

},

Also, this build needs to work for the Amazon Appstore as well, so things that rely on google.play might not work.(?)

Anyway, I’m sorry this is proving to be such a hassle.

You can remove the ads identifier. It seemed to be a requirements for apps flyer though. It would be interesting to see how it would work without it. In any case apps flyer is included in the AndroidResource folder.

Ah- so it is! (I’m afraid I don’t know anything about native android building.)
But this configuration works with a standard simulator build?

Yes. This is not native at all. Standard simulator build. Just open it in the simulator and build it. If you look at main, I am referencing both plugin.

I installed it on an android device without a problem.
I also just installed it on a kindle without a problem.

Fantastic! I’m looking forward to digging in and getting this integrated.
Thank you again for your help!