Search Unity

UnityAds - Not working from services and big issue with asset store

Discussion in 'Unity Ads' started by josephsaade, May 29, 2017.

  1. josephsaade

    josephsaade

    Joined:
    Apr 18, 2016
    Posts:
    46
    Hello,

    As detailed here:
    https://forum.unity3d.com/threads/b...rom-services-window-use-asset-package.453084/

    Currently, if I enable the Ads from services, they do not work at all.

    If I download from asset store, UnityAds.aac is conflicting with other android libraries.
    I am getting the error:
    Code (csharp):
    1.  
    2. trouble writing output: Too many field references: 67237; max is 65536.
    3. You may try using --multi-dex option.
    4.  
    I do not have that many libraries included in the project and all of them are up-to date.
     
  2. mikaisomaa

    mikaisomaa

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    365
    Hi,

    You've reached the Android method count limit - which SDKs / plugins do you have integrated in your project?

    Perhaps you might want to consider removing some unused / big plugins from the project?
     
  3. josephsaade

    josephsaade

    Joined:
    Apr 18, 2016
    Posts:
    46
    By trial and error, I managed to get it down to 2 conflicting aar included: "support-v4-23.4.0.aar" and UnityAds.aar
    If I remove either one, the app compiles but of course does not work as expected (Facebook SDK is bundled with support-v4-23.4.0.aar)

    As for the plugins I am using:
    - OneSignal
    - Facebook
    - Google Play services
    - Adcolony
    - Chartboost
    - Native Plugins.

    PS: They are all working fine, I added and removed previous plugins before without getting into that error.

    The only solution so far is not to use UnityAds.
     
  4. mikaisomaa

    mikaisomaa

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    365
    Hi,

    It should work when removing / disabling importing the latest of these two libraries. You should be able to use the other library with both libraries that have this dependency. Have you tested this yet?

    You might still have the method count issue after this. Are you using all of these libraries?
     
  5. josephsaade

    josephsaade

    Joined:
    Apr 18, 2016
    Posts:
    46
    Well sure I am using them, I would expect any game on the store to use at least those plugins if not more.

    So I had to swap some stuff around, basically FB SDK would still work for login if you remove "support-annotations-23.4.0.jar" and "support-vector-drawable-23.4.0.aar".

    So by removing those libraries, the compilation works including having UnityAds.

    But as a better alternative, is there a timeline for solving this multi-dex issue (probably have the android build internally us multi-dexing).

    Thanks
     
unityunity