Search Unity

Utter frustration trying to build for Android with plugins

Discussion in 'Android' started by arkon, Jul 13, 2016.

  1. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    My latest game is finished and released on IOS but 2 days ago I started on the Android version. This should have been a 30 minute exercise as nothing needed to be changed, just re target to Android.

    I use only 3 plugins, they are prime31 Admob Combo & IAP Combo plus the Vungle plugin from the Vungle SDK and website. (all 3 work together fine on IOS)

    When I build for Android the build fails and I get 2 errors which I've pasted into pastebin here:
    http://pastebin.com/FjizpH7C
    http://pastebin.com/KrPNZ9LS

    I've tried twice over the last 48 house to get help from Prime31 but only get the usual "It's someone else's fault" type answer, and Vungle to their credit did answer but just told be to remove Vungle from the game!
    I use Vungle as the fall back when Unity Ads runs out of Adverts to deliver.

    I currently don't know what to do, I can't release my Android port and neither of the plugin authors seem to care or help.
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,447
    just random guessing,
    I guess you tried both mono and il2cpp already?

    error says
    Attribute "imageAspectRatioAdjust" already defined with incompatible format
    AndroidManifest.xml
    so maybe there are multiple of those files..?

    or just remove vungle for now, if that fixes it, so then can at least publish..
     
  3. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    My frustration is this all used to work fine, but then Prime31 updated his plugins to use .aar files which I believe must contain the problem. I had to update the plugins to be able to enable bitcode on IOS.
    I can't even look inside or edit the .aar files to see what the incompatible format actual is.

    I think I am more frustrated at Prime31's lack of support, they broke the way the plugin works with other plugins then wash their hands of it.
     
  4. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,422
    Not 100% sure this will work for you, but for andorid builds with .aar files - I remove these from unity, then generate a Android project from Unity, then open the project in Android Studio and add the AAR files to the project there - it'll assist in fixing problems with manifests etc.

    I have a few projects where I've found this to be the only solution. It's a major nuisance and seriously hinders development workflow, but it works (for me).
     
  5. r-pedra

    r-pedra

    Joined:
    Dec 4, 2015
    Posts:
    104
    If they changed .jar by .aar, the problem is here.
    When you updated the plugin, it added the .aar but did not removed the .jar.
    .aar and .jar are compiled libraries. So it contains the code of Prime31 for exemple.
    If there are 2 libraries creating the same function(here, it seems that "imageAspectRatioAdjust" is defined 2 times), the compiler will exit with an error because it don"t know what to choose between these 2 functions.
    To keep the ability to update Prime31, I suggest you find the .jar libraries (that should have a similar name as the .aar) and remove it.
     
    shaderop and larku like this.
  6. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    Thanks very much for the help, I removed the google-play-services_lib so to just leave the .aar and it builds fine now with no errors. I'm testing it all out now. Thanks again for the help, its a shame the plugin developers are not more helpful.
     
    larku likes this.
  7. r-pedra

    r-pedra

    Joined:
    Dec 4, 2015
    Posts:
    104
    They should have developed an editor tools that looks for the .jar file and delete it, or made an UPDATE readme.

    You should know that many plugins use Google Play Service library, so if you have a compilation problem saying there are duplicate symbols, always watch for it. Plugins developer rarely take the time to ensure that their plugins does not conflict with other common plugins(Most of plugins use the same method, .aar or .jar and custom manifest file).
    Moreover you should always watch your AndroidManifest file, some plugins overwrite it, and if you have multiple plugins, they will override each other.

    EDIT: All I say here is the result of many, many, many hours of finding what is delaying my releases...
     
  8. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    I hear you loud and clear. On this monday my son asked me what I was going to do today and I said today is Android day, then 3 days later still at it. Almost lost the will to live.
     
  9. r-pedra

    r-pedra

    Joined:
    Dec 4, 2015
    Posts:
    104
    Ahah, now you should be able to play with your son ^^

    (This is why, for little things, I make my own plugin now, this way I'm sure I have no problem. Version control is a good way to find what have changed in the plugin and ease your bug research)
     
  10. iamsidv

    iamsidv

    Joined:
    Jan 24, 2013
    Posts:
    17
    I am trying to make a google sign-in unity plugin for android. I have gone through this post (and others similar to these) carefully and will test the same as per my requirement. The whole confusion was because of the .jar and .aar as I used to make plugins in eclipse. Perhaps the whole thing got messed up just because of Android Studio coming and eclipse being discontinued.