Search Unity

2 large editor only textures included in build from UnityAds on cloud build.

Discussion in 'Unity Ads & User Acquisition' started by Ender_7, Nov 28, 2019.

  1. Ender_7

    Ender_7

    Joined:
    Nov 22, 2015
    Posts:
    11
    Hi there,

    I've noticed that there are 2 large textures from unity ads that get auto included into the build:

    [Unity]  8.0 mb     3.0% Packages/com.unity.ads/Editor/Resources/Editor/landscape.jpg
    [Unity] 8.0 mb 3.0% Packages/com.unity.ads/Editor/Resources/Editor/portrait.jpg


    I've managed to have these not include in the build when i build locally by going to:
    C:\Users\User\AppData\Local\Unity\cache\packages\packages.unity.com\com.unity.ads@2.0.8\Editor\Resources\Editor


    and manually deleting the folders, but this isnt an option when building on cloud build. I've tried using a cloudbuild preprocess function to delete the filed prior to building:
    FileUtil.DeleteFileOrDirectory("Packages/com.unity.ads/Editor/Resources/Editor/landscape.jpg");

    But this didnt seem to delete them properly as they were still included in my build report.

    How can i remove these files from my build on cloudbuild as they contribute a significant amount to the build when building for Android?
    I'm using Unity 2017.4.22f1 and I dont even have the unity ads package installed, rather im using the GoogleMobileAdsUnityAdsMediation-2.3.0 adapter for admob.

    Thanks,
    Daniel.
     
  2. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @Ender_7

    Do you have Unity Ads enabled in the Services window? If so, try disabling that. Alternatively, you can select Advanced options and disable the built-in extension. I'm not an expert on Cloud Build, but that setting should persist to those builds as well.
     
  3. sbankhead

    sbankhead

    Unity Technologies

    Joined:
    Jul 27, 2014
    Posts:
    97
    By default in certain versions of unity the 2.0.8 ads package was installed by default. You can remove this by going to package manager UI in the Window menu and removing the ads package. Since you include unity ads via adMob, you do not need the direct Unity Ads Implementation served via packman. I believe during the build process those files should be removed automatically via the code stripping process but just in case, this should solve your issue.