Search Unity

Question Create symbols.zip for Android

Discussion in 'Unity Build Automation' started by Revolter, Jul 4, 2022.

  1. Revolter

    Revolter

    Joined:
    Mar 15, 2014
    Posts:
    216
  2. vovkas

    vovkas

    Joined:
    Nov 30, 2015
    Posts:
    16
    Hi.
    Try this code:
    Code (CSharp):
    1. #if UNITY_CLOUD_BUILD
    2.     public static void PreExport(UnityEngine.CloudBuild.BuildManifestObject manifest)
    3.     {
    4.         EditorUserBuildSettings.androidCreateSymbols = AndroidCreateSymbols.Public;
    5.     }
    6. #endif
    Call this code from Pre-Export Method.
     
    leni8ec likes this.
  3. Revolter

    Revolter

    Joined:
    Mar 15, 2014
    Posts:
    216
    Thanks, did anyone manage to upload them to Firebase from UCB?
     
  4. vovkas

    vovkas

    Joined:
    Nov 30, 2015
    Posts:
    16
    You can upload Symbols manualy.
     
  5. Meatloaf4

    Meatloaf4

    Joined:
    Jul 30, 2013
    Posts:
    183
    Hey @vovkas would you mind elaborating on what you meant by you can upload symbols manually?

    Thanks in advance!
     
  6. vovkas

    vovkas

    Joined:
    Nov 30, 2015
    Posts:
    16
    Hi. At Unity Game Service > Dev Ops (tab) > Cloud Diagnostics > Debugging Symbols > Upload Symbol File
     
  7. tim_2up

    tim_2up

    Joined:
    Jul 7, 2020
    Posts:
    3
    Has anyone got the above code snippet to actually work on Unity Cloud Build? When I have tried, I get the following errors from Unity Cloud Build:

    error CS0103: The name 'EditorUserBuildSettings' does not exist in the current context
    error CS0103: The name 'AndroidCreateSymbols' does not exist in the current context


    It seems that the class and the enum aren't available to Unity Cloud Build, only locally. (Unity 2021.3.2, though I also tried 2022.1.15.)

    Native debug symbols are really nice to have for the Play Store. I feel like I must be missing something! Is there really no simple way to tell UCB to create them?
     
    Last edited: Sep 6, 2022
  8. tim_2up

    tim_2up

    Joined:
    Jul 7, 2020
    Posts:
    3
    I also tried configuring Gradle to bundle the symbols into the aab archive, but the version of the plugin that ships with Unity isn't new enough. Since there doesn't seem to be a way to get Unity Cloud Build to build with a custom Gradle, that route isn't available either.
     
  9. tim_2up

    tim_2up

    Joined:
    Jul 7, 2020
    Posts:
    3
    A-ha. I had missed a critical part of the solution. I had been trying to pre-process using
    IPreprocessBuildWithReport (as I normally would), whereas I needed to call the pre-export method specifically by name in Unity Cloud Build.

    So:

    Code (CSharp):
    1. #if UNITY_CLOUD_BUILD
    2.  
    3. using UnityEditor;
    4.  
    5. namespace MyApp.Editor
    6. {
    7.     public static class PreExportCloudBuild
    8.     {
    9.      
    10. #if UNITY_ANDROID
    11.     public static void PreExportAndroid(UnityEngine.CloudBuild.BuildManifestObject manifest)
    12.     {
    13.         EditorUserBuildSettings.androidCreateSymbols = AndroidCreateSymbols.Public;
    14.     }
    15. #endif
    16.  
    17.     }
    18. }
    19.  
    20. #endif
    And then called MyApp.Editor.PreExportCloudBuild.PreExportAndroid as a named Pre Export Method in Unity Cloud Build.
     
  10. yhytiuk

    yhytiuk

    Joined:
    Feb 7, 2023
    Posts:
    1
    Can anyone guide me to create an icon?