Search Unity

2019.3.10f1 initializeaddressablesasync() null reference

Discussion in 'Addressables' started by duartedd, Apr 21, 2020.

  1. duartedd

    duartedd

    Joined:
    Aug 1, 2017
    Posts:
    150
    Hello
    Does anyone else build standalone and get
    null reference exception with the
    Addressables.InitializeAsync().Completed += objects =>
    {
    call?

    thanks!
    daniel
     
  2. duartedd

    duartedd

    Joined:
    Aug 1, 2017
    Posts:
    150
    upload_2020-4-21_8-32-8.png

    using reporter (log viewer) this shows the errors i get
     
  3. duartedd

    duartedd

    Joined:
    Aug 1, 2017
    Posts:
    150
    tried updating to the latest version of addressables - no dice
     
  4. duartedd

    duartedd

    Joined:
    Aug 1, 2017
    Posts:
    150
    play mode works fine in the editor even with simulate groups is checked - trying to rebuild the content ,copying over the files to my webserver again and then rebuild the game,

    this all worked fine in 2018 - but 2018 has a weird bug with the audio mixer and setfloat not wokring with addressables so trying to work around it with 2019
     
  5. duartedd

    duartedd

    Joined:
    Aug 1, 2017
    Posts:
    150
    opp rebuilding all the things fixed it- but for some reason still in standalone mode the volume bars wont change the sounds in the game - but editor it works fine - will try to do some more troubleshooting with the reporter console now and see what i can find
     
  6. duartedd

    duartedd

    Joined:
    Aug 1, 2017
    Posts:
    150
    var floater = ConvertToDecibel(_value / MusicSlider.maxValue);
    Debug.Log(floater + " 1");
    Mixer.SetFloat("MusicVol", ConvertToDecibel(_value / MusicSlider.maxValue)); //Dividing by max allows arbitrary positive slider maxValue
    Mixer.GetFloat("MusicVol", out floater);
    Debug.Log(floater + " 2" );



    so with i can see the db values are being changed appropriately with the getfloat command - but the volume doesnt change on the audio source

    upload_2020-4-21_10-1-51.png
     
  7. duartedd

    duartedd

    Joined:
    Aug 1, 2017
    Posts:
    150
    okay narrowed it down - think it has something to do with the scene that was loaded was an addressable loaded scene - my other scene where i have the same sort of settings configuration - works fine but it isnt loaded built in - its loaded via addressable
     
  8. duartedd

    duartedd

    Joined:
    Aug 1, 2017
    Posts:
    150
    Yeesh Fixed - so it was set via monobehaviour serialized so what i did was:
    in my preloaded scene - created a getmixer method that returns the mixer - that class is an single instantiated class so i can call that class ( happens to be my soundmanager) - in which i just call the getmixer method throw that in my settings scene and removed it being serialized problem solved - audio now changes appropriately. also you probably dont even need that getfloat method and can just call that mixer from the soundmanager and itll work too