Firebase or specific Android versions trigger app_clear_data on first_open, disrupting our funnel

Open
#1,390 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
android, csharp, unity

Research direction

Start with the Android manifest entry for MessagingUnityPlayerActivity and the FirebaseApp.CheckAndFixDependenciesAsync initialization shown in the report. Reproduce on the listed Samsung devices and Android versions using the Unity quickstarts, then compare DebugView, device logs, and Analytics events. Done means identifying a repeatable cause for the first_open/app_clear_data sequence or documenting why it cannot be reproduced.

Written by the indexing model from the issue text.

Description

new
[REQUIRED] Please fill in the following fields:
  • Unity editor version: 2021.3.44f1
  • Firebase Unity SDK version: 12.3.0
  • Source you installed the SDK: .unitypackage (.unitypackage or Unity Package Manager)
  • Problematic Firebase Component: Analytics (Auth, Database, etc.)
  • Other Firebase Components in use: Messaging and Crashlytics (Auth, Database, etc.)
  • Additional SDKs you are using: Facebook, GameAnalytics, Appmetrica and Appsflyer (Facebook, AdMob, etc.)
  • Platform you are using the Unity editor on: Windows (Mac, Windows, or Linux)
  • Platform you are targeting: Android (iOS, Android, and/or desktop)
  • Scripting Runtime: IL2CPP (Mono, and/or IL2CPP)
[REQUIRED] Please describe the issue here:

We observe approximately 50% abandonment at the first_open event.
image
Through investigation, we found that certain devices (e.g., Samsung S23 Ultra and S24 Ultra on Android 13 and 14) only log first_open and app_clear_data in the initial session, with no further events recorded.

  • Local Test Findings: Testing locally on these devices shows that Firebase initializes correctly, and events are sent to the server without any exceptions or errors.
  • App Clear Data: We have verified that these devices are not manually triggering app_clear_data

Example User at Firebase User Explorer:
image

(Please list the full steps to reproduce the issue. Include device logs, Unity logs, and stack traces if available.)
We don’t have specific reproduction steps, but during DebugView, events are being sent correctly, and there is no app_clear_data event.

Steps to reproduce:

Have you been able to reproduce this issue with just the Firebase Unity quickstarts (this GitHub project)?

What's the issue repro rate? (eg 100%, 1/5 etc)

What happened? How can we make the problem occur?
This could be a description, log/console output, etc.

If you have a downloadable sample project that reproduces the bug you're reporting, you will
likely receive a faster response on your issue.

Relevant Code:

it might be related with androidManifest file so i will share some of them;
we are using firebase activity:

<application android:theme="@style/UnityThemeSelector" android:icon="@mipmap/app_icon" android:label="@string/app_name" tools:replace="android:allowBackup" android:allowBackup="false" android:isGame="true">
    <activity android:name="com.google.firebase.MessagingUnityPlayerActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:exported="true">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
      <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
    </activity>
    <service android:name="com.google.firebase.messaging.MessageForwardingService" android:permission="android.permission.BIND_JOB_SERVICE" android:exported="true"></service>
</application>

Some Permissions in use:

"android.permission.WRITE_EXTERNAL_STORAGE"
"android.permission.READ_EXTERNAL_STORAGE"

Initialization Code: Firebase initializes upon checking dependencies
After initialization we start sending events

FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
{
  var dependencyStatus = task.Result;
  if (dependencyStatus == DependencyStatus.Available)
  {
    IsInitialized = true;
  }
  else
  {
    IsInitialized = false;
  }
}, TaskScheduler.FromCurrentSynchronizationContext());
Dominant language
C#
Stars
923
Forks
456
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from firebase/quickstart-unity

All issues in firebase/quickstart-unity

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.