Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Question Problem with files in 'Resources' when building AAB split

Discussion in 'Android' started by ABB13, Jan 5, 2024.

  1. ABB13

    ABB13

    Joined:
    Apr 23, 2018
    Posts:
    82
    I'm experiencing issues with my application published on the Google Play Store. While everything worked fine in various tests with the APK, unfortunately, in the final AAB build for the Google Play Store with the split application binary option enabled, there are several problems. Just for your information, the final AAB file size is 1.08 GB.

    I believe the main issue stems from the fact that the content of the "Resources" folder is not being transported into the final build. I say this because inside the folder, there are simply four files: three JSON files and a Vuforia plugin configuration file.

    The errors that occur are as follows:

    1. "Error Unity: The Vuforia Developer Agreement needs to be accepted before using Vuforia in an application."
    2. A null reference error on the method that handles loading the JSON file with "Resources.Load(...)."
    I managed to avoid the second error by manually loading the JSON files into the persistent data folder. This way, there are no errors related to the null reference of the JSON file, but the Vuforia error persists because it probably tries to find the configuration file from "Resources" without success.

    In light of this, could you suggest a method for transporting the content of the "Resources" folder into the final AAB file? Do you have any advice or other insights that could help me?
     
  2. ABB13

    ABB13

    Joined:
    Apr 23, 2018
    Posts:
    82
    No one can help me?
     
  3. MichaelHeiml82

    MichaelHeiml82

    Joined:
    Nov 2, 2009
    Posts:
    30
    Which Unity and Android Version do you use?

    I recently have the issue that Resource.Load does not work anymore (does return null) although the code worked for 4 years now.

    Unity 2022.3.17 Silicon and Android 14

    Problem is since update of either of those.
     
    ABB13 likes this.
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    12,015
    Are you exporting to Android Studio or are you building the aab directly?
     
  5. MichaelHeiml82

    MichaelHeiml82

    Joined:
    Nov 2, 2009
    Posts:
    30
    Directly
     
  6. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    12,015
    There was a google (?) bug when using Android Studio where Unity couldn't access anything in the install-time bundle (including resources).

    https://forum.unity.com/threads/aab-and-resources-load.1393234/

    I don't know if it was ever fixed, we just stopped exporting to android studio and that solved the issue. Maybe the bug made its way to the stuff Unity uses to build aabs directly.
     
  7. ABB13

    ABB13

    Joined:
    Apr 23, 2018
    Posts:
    82
    I have Unity 2022.3.12 on Android 13.

    I noticed that this issue arises if the AAB file you export is larger than a certain size X, which I don't know. In fact, I managed to solve the problem by compressing as much as possible the files within the application. I reduced the initial weight from 1GB to 222MB, and by doing so, everything works perfectly.

    So, was the issue for you related to exporting from Android Studio?
     
  8. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    12,015
    Exporting to Android Studio, yes.
     
    ABB13 likes this.
  9. MotionBrain

    MotionBrain

    Joined:
    Dec 5, 2015
    Posts:
    36
    So nobody answered OPs question. Is there any solution to this? My vuforia database does not load and can’t be find.

    Aab + split binary
    Unity 2022.3.17f
     
  10. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    12,015
    The answer I had was if you were exporting to Android Studio, to not export to Android Studio since there is (was?) a bug there. Other than that, I do not know.
     
  11. MotionBrain

    MotionBrain

    Joined:
    Dec 5, 2015
    Posts:
    36
    Last edited: Apr 22, 2024