Search Unity

Getting an App Crash when Calling UnloadUnusedAssets after calling an Android Plugin

Discussion in 'Android' started by emongev, Oct 24, 2019.

  1. emongev

    emongev

    Joined:
    Jul 5, 2012
    Posts:
    36
    Im trying to use the following library:

    https://github.com/tanersener/mobile-ffmpeg

    And the library is working fine and is doing whats expected until i get a random crash, after some profiling i noticed a pattern on GC Allocation being released every N times i did a certain action, which matched the crashing.

    I mapped a button to directly call Resources.UnloadUnusedAssets and if i press it after doing a call to the android library, the app dies.

    The logcat is showing the following: https://ghostbin.co/paste/vt9t4

    I am at a loss for what to do to get it working? My idea is that somehow the native plugin is grabbing memory that Unity is later trying to clear and panicking when doing it. If thats the case how would I go about preventing that?

    Thanks, and if you are helping out you're great and a saviour!
     
  2. emongev

    emongev

    Joined:
    Jul 5, 2012
    Posts:
    36
    Ive opened a bug report with a repro project in case someone from Unity sees this, its Case 1195310.