How to fix the build error with Intel XDK and Appodeal?

Appodeal_properly_1200x500

 

Current official instructions

Appodeal’s documentation says that in order to have Appodeal working with Construct 2 you need to:

  1. Install Appodeals C2 plugin: http://www.appodeal.com/system/uploads/sdk_release/file/213/appodeal-sc2-1.14.9.zip
  2. Add Google Play Sercives plugin to Intel XDK: https://github.com/appodeal/PhoneGap-GooglePlayServices.git
  3. Add Appodeal Cordova plugin to Intel XDK: https://github.com/appodeal/cordova-plugin.git

 

Unfortunately this brings nothing else but a build error.

mIwzno1

 

The problem

Problem is that there are duplicate libraries. The android-support-v4.jar library from Appodeal’s SDK is giving the issue.

 

How to fix it

After spending some time with Appodeal’s support and testing some solutions it turns out that there are two ways for making things work.

Solution 1

  1. Remove Google Play Sercives plugin from Intel XDK
  2. Remove Appodeal Cordova plugin from Intel XDK
  3. Add this plugin in Intel XDK instead: https://github.com/Tamplier/cordova-plugin.git

This plugin is an Appodeal plugin version without google-play-services and support-v4 libraries. With such combination it worked like a charm for me.

Solution 2

  1. Remove Google Play Sercives plugin from Intel XDK
  2. Remove Appodeal Cordova plugin from Intel XDK
  3. Download Appodeal Cordova plugin to your hard drive: https://github.com/appodeal/cordova-plugin
  4. Edit plugin.xml and make changes manually like here: https://github.com/Tamplier/cordova-plugin/commit/ec22b683590462c2c506e12eeb0102975b7dde84?diff=split
  5. Import edited plugin to Intel XDK using “Import local plugin” option in Plugin Manager

I haven’t tested this solution, however it is one of solutiones provided by official Appodeal’s support.

Please note that in both cases Google Play Services are not needed.

 

Game with integrated Appodeal ADS

I’ve integrated Appodeals ADs in one of my games. You can see how it works here: https://play.google.com/store/apps/details?id=com.wtfgamesgroup.magicshapes

 

Construct 2 Appodeal implementation

If you have problems with setting ads in your Construct 2 project, here is the example of interstitial + skippable video implementation.

c2-implementation

 

 

11 comments to How to fix the build error with Intel XDK and Appodeal?

  • skn  says:

    May I ask what’s up with disabling auto cache and then cache’ing ad?
    what cache ad do and how it works in conjunction with On ad cloesd?

  • Toby R  says:

    Caching is basically a preloading. By disabeling autocaching and doing it manualy you have a full controll over it. There might be situation where you want to cache ad in the particular screen to not lag the game. In this current example I’ve shown it doesn’t matter, it will behave the same way. Just wanted to highlight that you should always set ad options before initializing Appodeal ADs.

  • Marc Lawson  says:

    Hi, works fine but before when i was using admob i was able to use the phonegapgame google play services plugin and it worked. Now i seem to be unable to use appodeal and phonegapgame plugin.

    Any ideas how i can get google leaderboard services etc with appodeal?

    Thanks

  • Toby R  says:

    Hi Marc! I think you should not use any Cranberrygame’s “phonegap” plugin. They are deprecated. Try Cranberrygame Cordova plugins instead (it’s basically the same just new version). I think Cipriux had exactly the same problem on Scirra forum and this tutorial worked for him, but he was using Cordova plugin if I remember well. Give it a try and let me know if it worked for you.

  • Lucky Rawat  says:

    hi
    this is not worked with me
    but i have try different that works but have some questions
    .
    I have remove appodeal’s google play services plugin.
    Now with only com.appodeal.plugin I build apk and it work perfect
    but my question is what is the use of google play service plugin because without it ads are showing

  • Toby R  says:

    Hi Lucky Rawat
    Would be nice if you could share your solution as well, it’s always good to have more options to try out.
    Regarding Google Play Services. Normally it is used for various Google Play features like achievements or leaderboards. Why Appodeal added it to their library? I’m not sure. This is a question to Appodeal. Surely they were using some API functions of GPS lib which in the end wasn’t a critical dependency for them so it can be safely removed.

  • jimy  says:

    but how about if use with plugin google play service? i get error if build with google play service, any solution?

  • Per  says:

    Toby, you are the man!

    I got the error, and tried the first solution provided here, worked like a charm. I will try the Interstitial + Skippable Video and let you know asap.

    Your blog is very practical and informational, keep it up!

    • Toby R  says:

      Thanks Per! Glad I could help 🙂

  • Flemming  says:

    @Lucky Rawat

    “I have remove appodeal’s google play services plugin.”

    How is that done ?

    I use Intel XDK and haveing this issue
    > Error: more than one library with package name ‘com.google.android.gms’

    REGARDS

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">