Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Hang-up Issue with Firebase Initialization (CheckAndFixDependenciesAsync) on Android 15 and Inquiry on 16KB Page Size ELF Alignment Support #1180

Closed
b3lypscfcon opened this issue Feb 7, 2025 · 3 comments · Fixed by #1184

Comments

@b3lypscfcon
Copy link

Description

We are encountering a problem on Android 15 (API Level 35) where Firebase initialization does not complete when running on an emulator. Using Unity 2022.3.23f1 and Firebase Cloud Messaging (tested with both version 11.9.0 and 12.5.0) in our project, the task initiated by Firebase.FirebaseApp.CheckAndFixDependenciesAsync() never returns. As a result, the callback provided via ContinueWithOnMainThread is never executed, and eventually, the app crashes with a native error. Notably, the same code works as expected on an Android 14 emulator.
In our project, the TargetSDKVersion is 35 and the minSDKVersion is 25.

Additionally, during our investigation, we observed that the latest Firebase for Unity SDK (version 12.5.0) does not build its native .so files with ELF alignment for 16KB page sizes—a new requirement in Android 15. We would like to inquire if there is a roadmap or planned update regarding support for 16KB page sizes in the Firebase for Unity SDK.

Reproducing the issue

  1. Setup:

    • Unity version: 2022.3.23f1 (Android build)
    • Firebase Cloud Messaging: 11.9.0 (also tested with 12.5.0)
    • TargetSDKVersion: 35
    • minSDKVersion: 25
    • Running on an Android 15 (API Level 35) emulator
  2. Code Implementation:
    Integrate Firebase Cloud Messaging into your project and initialize Firebase using the following code:

    Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task =>
    {
        var dependencyStatus = task.Result;
        if (dependencyStatus == Firebase.DependencyStatus.Available)
        {
            Debug.Log("Firebase Initialized");
            // Register Firebase Messaging events
            Firebase.Messaging.FirebaseMessaging.TokenReceived += OnTokenReceived;
            Firebase.Messaging.FirebaseMessaging.MessageReceived += OnMessageReceived;
        }
        else
        {
            Debug.LogError($"Firebase dependency check failed: {dependencyStatus}");
        }
    });
  3. Execution:

    • Run the application on an Android 15 emulator.
    • Observe that none of the code inside the ContinueWithOnMainThread callback (e.g., the log statement "Firebase Initialized") is executed.
    • Shortly thereafter, after invoking FirebaseHandler.AppUtils.PollCallBacks(), the app crashes with a native error. The crash log provides little useful information, suggesting an internal native exception (such as a NullPointerException).
  4. Contrast:
    When running the same code on an Android 14 emulator, the initialization completes normally and the callback is executed without issue.

Firebase Unity SDK Version

11.9.0, 12.5.0

Unity editor version

2022.3.23f1

Installation Method

.unitypackage

Problematic Firebase Component(s)

Messaging

Other Firebase Component(s) in use

No response

Additional SDKs you are using

No response

Targeted Platform(s)

Android

Unity editor platform

Windows

Scripting Runtime

IL2CPP

Release Distribution Type

Pre-built SDK from https://firebase.google.com/download/unity

Relevant Log Output

If using CocoaPods for Apple platforms, the project's Podfile.lock

No response

@google-oss-bot
Copy link

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@argzdev
Copy link

argzdev commented Feb 7, 2025

Hey @b3lypscfcon, I was able to reproduce the issue. Let me bring this up to engineers and check what's going on.

Additionally, during our investigation, we observed that the latest Firebase for Unity SDK (version 12.5.0) does not build its native .so files with ELF alignment for 16KB page sizes—a new requirement in Android 15. We would like to inquire if there is a roadmap or planned update regarding support for 16KB page sizes in the Firebase for Unity SDK.

Thanks for bringing this to our attention. Currently, I haven't heard any planned updates for this. This would likely be a feature request that we have to work on sometime in the future. We'll keep this under our radar, however we don't have any timelines to share as of the moment.

@b3lypscfcon
Copy link
Author

Hi @argzdev,

Thank you for your response and for reproducing the issue. I appreciate your efforts in escalating the Android 15 crash to the engineering team.

Regarding the Android 15 crash, please continue investigating and keep us updated when a fix becomes available.

Additionally, I would like to request that you share the planned schedule or roadmap for adding support for 16KB page sizes in the Firebase for Unity SDK once that information is available.

For additional context from our side, we have observed the following:

  • We confirmed that the native shared libraries in the latest Firebase for Unity SDK (version 12.5.0) are not built with ELF alignment for 16KB page sizes. Specifically, the affected libraries appear to be libFirebaseMessaging.so and libFirebaseCppApp-12_5_0.so.
  • When running our app on an emulator that supports 16KB page sizes, we experience a crash during the loading of libFirebaseCppApp-12_5_0.so.
  • Our testing environment for this observation is Unity 2022.3.56 for Android with a TargetSDKVersion of 34, a minSDKVersion of 25, and using IL2CPP.

Thank you again for addressing these issues. I look forward to your updates on both the Android 15 crash and the support for 16KB page sizes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants