Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question Build size increase when updating to IAP 4.2+

Discussion in 'Unity IAP' started by karyll, Sep 2, 2022.

  1. karyll

    karyll

    Joined:
    Apr 4, 2017
    Posts:
    46
    Hi,

    Due to Google Play Billing Library 4.0 being enforced, I have updated to from IAP 4.1.3 to IAP 4.4.0. I understand that now the Analytics library is being added to my project as a dependency. In my case this comes with a 5MB increase in build size(see file sizes before and after update). The previous version (4.1.3) was just ~1MB in my build, and now I get 5MB of extra stuff that I don't need. On top of that, I have also an Instant version of my game, and the challenge there is to be under 15 MB core size. Before updating my build sizes were ~14MB, and after update I'm above 16MB which will prevent me from rolling out future updates.

    Is there a way to get rid of the new Analytics from my build and just stick with the IAP?

    Installed version size compare
    upload_2022-9-2_16-5-53.png

    Instant version size compare
    upload_2022-9-2_16-3-50.png
    upload_2022-9-2_16-7-26.png
     

    Attached Files:

  2. HamzaSheikh3334

    HamzaSheikh3334

    Joined:
    Aug 12, 2022
    Posts:
    4
    Sorry cause it's irrelevant but does IAP 4.4.0 solves the google play billing version 4 error only play console. and also mention your unity version. your response is highly appreciated. Thank you :)
     
  3. karyll

    karyll

    Joined:
    Apr 4, 2017
    Posts:
    46
    I did not go productive with 4.4.0, I rolled back to 4.1.3, so I do not know about the play console message. In theory it should dissapear.

    I'm on 2020.3.33
     
  4. HamzaSheikh3334

    HamzaSheikh3334

    Joined:
    Aug 12, 2022
    Posts:
    4
    it worked for me but not my admob ads aren't showing up.. i guess it would be an sdk issue :(
     
  5. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    The size increase is expected, we have additional core dependencies . You need Unity IAP 4.4.0 or above to avoid the message from Google.
     
  6. karyll

    karyll

    Joined:
    Apr 4, 2017
    Posts:
    46
    Thanks Jeff for clarifying.
     
  7. comixplay

    comixplay

    Joined:
    Sep 27, 2013
    Posts:
    104
    Hi Jeff,
    Is there anything we can edit/remove/tweak ourselves to avoid those few megabytes?
     
    karyll likes this.
  8. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Unfortunately I don't believe so at this time, but I've mentioned the issue to the engineering team.
     
    karyll likes this.
  9. karyll

    karyll

    Joined:
    Apr 4, 2017
    Posts:
    46
    hopes intensify... :)
     
  10. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you share your manifest.json? Perhaps we can find an unneeded package or dependency to keep you under 15Mb
     
  11. karyll

    karyll

    Joined:
    Apr 4, 2017
    Posts:
    46
    Here it is. I added the "txt" extension so it can be uploaded here.
     

    Attached Files:

  12. GamerixTech

    GamerixTech

    Joined:
    Jun 13, 2022
    Posts:
    5
    Hi Jeff, Even we are concerned about the increase in 5MB build size due to IAP 4.4.0+ upgrade . Any reduction in size is highly appreciated.
     
    Dasp and karyll like this.
  13. abdullahdar

    abdullahdar

    Joined:
    Aug 10, 2020
    Posts:
    7
    We have added IAP 4.4.0+ and it has increased our size by 5.5 mb. I am amazed why such a small package is taking so much size.

    Does unity even test before publishing package? Is the size aspect even taken into consideration?

    Overall the package size should be reduced, on top of that there should be an option to choose purchasing platform if anyone chooses only 1 platform then it should reduce the size even further.
     
    Dasp and karyll like this.
  14. abdullahdar

    abdullahdar

    Joined:
    Aug 10, 2020
    Posts:
    7
    Hi Jeff,

    Any help regarding how we can reduce the size with latest IAP 4.4.0+ plugin?

    Earlier it used to take less than a mb but now it is taking 5.5+ mb in build size.
     
  15. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    I've mentioned it to the team a couple of times now. So far, it is looking like expected behavior with the current dependencies. I'll keep trying!
     
  16. abdullahdar

    abdullahdar

    Joined:
    Aug 10, 2020
    Posts:
    7
    Thanks for the reponse. Meanwhile is there anything else we can do to reduce size manually ?
     
  17. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Not to my knowledge, sorry.
     
    abdullahdar likes this.
  18. karyll

    karyll

    Joined:
    Apr 4, 2017
    Posts:
    46
    Jeff, I've been browsing through the discussions on this sub-forum and correct me if I'm wrong, but all these extra dependencies are added so that revenue is reported via the new Analytics?
     
  19. abdullahdar

    abdullahdar

    Joined:
    Aug 10, 2020
    Posts:
    7
    Hi Jeff,

    I can see that 4.5.0 has been released, has the issue been addressed in it?'

    Also is that any page/forum where we can check to see if there are any updates about this issue ?
     
    Last edited: Oct 4, 2022
  20. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    There are currently no plans to address the size that I am aware of.
     
  21. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    IAP has always required Analytics, it is how we are able to provide the package for free. Analytics allows you to track user engagement in your game, and allows us to gather usage metrics to better improve our product. This may help https://docs.unity.com/analytics/UnityAnalytics.html
     
  22. abdullahdar

    abdullahdar

    Joined:
    Aug 10, 2020
    Posts:
    7
    Thanks for the response
     
    JeffDUnity3D likes this.
  23. comixplay

    comixplay

    Joined:
    Sep 27, 2013
    Posts:
    104

    Hi Jeff,
    Thanks for checking this, I’m not sure how this thread didn’t get more responses.

    We spend literally weeks of work trying to shave a few KB from the build, by optimizing code, graphic assets, using special algorithms just so we can remove certain libraries and even not adding new features that will take too much space,

    And then all of a sudden we get this mandatory 4-5 MB increase just to force us to use Unity Analytics.

    From this thread (Q: Why does the IAP SDK depend on the UGS Analytics SDK?)
    https://forum.unity.com/threads/faq-for-iap-4-2-and-adoption-of-ugs-analytics.1327011/
    It seems that it was done for “ C# compilation expediency and performance efficiency”,
    Honestly, we would do fine without this efficiency, instead, we could add tons of new features to the game that will cost 4-5 MB

    I’m not really sure what are our options, we can try and learn how to implement IAP with native code, it’s something we never had to deal with because Unity covered those parts so far...
     
    abdullahdar likes this.
  24. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    In full transparency, we include Analytics as a dependency so we can offer IAP for free. We are able to gather anonymous usage information to help improve our platform. I've mentioned the file size increase to engineering.
     
    abdullahdar likes this.
  25. team_jolly_rogers

    team_jolly_rogers

    Joined:
    Jun 16, 2020
    Posts:
    3
    @JeffDUnity3D Any update form the engineering team? Build increase around 5.1 mb. We can add many features and assets in this 5 mb. Which is taken by IAP plugin. Please update about the issue.
     
    aqibb4t likes this.
  26. agorain

    agorain

    Unity Technologies

    Joined:
    Jun 28, 2022
    Posts:
    98
    Hi,
    Unfortunately, this issue is not being addressed at the moment but is under discussions.
     
    karyll likes this.
  27. comixplay

    comixplay

    Joined:
    Sep 27, 2013
    Posts:
    104
    Hi agorain,
    Is there any way to implement IAP without the unity package? (and preferably without resorting to native code)
    Google used to have their own implementation, but it doesn't support Google Play Billing 4
    https://developer.android.com/google/play/billing/unity
    And I guess most asset store assets use Unity IAP behind the scenes.
     
    karyll likes this.
  28. agorain

    agorain

    Unity Technologies

    Joined:
    Jun 28, 2022
    Posts:
    98
    Hi @comixplay
    You could do it by yourself meaning coding your own IAP layer or you could also check what the asset store could offer as an alternative.

    Most of them wrap our sdk, but you might find some who don't seem to use it at a first look.
     
  29. karyll

    karyll

    Joined:
    Apr 4, 2017
    Posts:
    46
    I'm using EasyIAP in my project and that's just a wrapper.

    @comixplay if you do find alternatives, please share :)
     
    agorain likes this.
  30. amir_unity912

    amir_unity912

    Joined:
    Apr 12, 2022
    Posts:
    3
    Updating to IAP package 4.4.1 increased my generated symbols file by around 500mb - even after stripping and rezipping, I'm still at 330mb (an increase of 90mb from previous build) which is above store limit. Any solution?
     
  31. hsgaminators

    hsgaminators

    Joined:
    Dec 19, 2021
    Posts:
    4

    Attached Files:

  32. abdullahdar

    abdullahdar

    Joined:
    Aug 10, 2020
    Posts:
    7
    In symbols folder, delete all the files with extension : dbg.so
    Zip the remaining, this will decrease your symbols size. We do the same when i have this issue.
     
  33. team_jolly_rogers

    team_jolly_rogers

    Joined:
    Jun 16, 2020
    Posts:
    3
    How long we have to wait for this?
    Play console requirement is to update all games IAP 4+. And it is increasing build size of all games. This is not fare at all.
     
  34. agorain

    agorain

    Unity Technologies

    Joined:
    Jun 28, 2022
    Posts:
    98
    team_jolly_rogers and karyll like this.
  35. team_jolly_rogers

    team_jolly_rogers

    Joined:
    Jun 16, 2020
    Posts:
    3
  36. Ozzy

    Ozzy

    Joined:
    Apr 3, 2013
    Posts:
    3
    Unfortunately this makes android instant games impossible as it makes even an empty project's build go past the 15.7mb limit
     
  37. karyll

    karyll

    Joined:
    Apr 4, 2017
    Posts:
    46
    I removed IAP's altogether from my instant build. Instead of the purchase workflow I just pop up a message "please install the game". It's stupid and it's sad, but it's better than not being able to update the game at all.
     
    team_jolly_rogers and Ozzy like this.