Does Firebase Crash Reporter work only under installation from Google Play?

295 views Asked by At

I want to add Firebase crash reporter to my Android project. I registered on the Firebase website and built my project. I added Firebase in my Android project (and the JSON file too).

I also added permissions to Internet connection in:

  <uses-permission
    android:name="android.permission.INTERNET"/>

<uses-permission
    android:name="ACCESS_NETWORK_STATE"
    />

I added the test code in my simple test project:

private TextView mTextView;


@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);


    try
    {
        mTextView.setText("Text");
    }
    catch (NullPointerException e)
    {
        FirebaseCrash.report(e);
    }


}

Then I tried to test the Firebase Android application in an actual device.

But Firebase Crash Reporting is not showing anything. Even after 24 hours, I didn't get any message from Firebase.

I suspect crash reporter doesn't work because I installed the application using the debugging tool of Android Studio, not from Google Play.

Does Firebase Crash Reporter work depending on the installation process (USB debugging or Google Play)?

============================================

Comprehensive discription of my mini test project.

1)It is my json file:

{
  "project_info": {
    "project_number": "484954907583",
    "firebase_url": "https://firstproj-88f01.firebaseio.com",
    "project_id": "firstproj-88f01",
    "storage_bucket": "firstproj-88f01.appspot.com"
  },
  "client": [
    {
      "client_info": {
        "mobilesdk_app_id": "1:484954907583:android:a907cc6a5354ad1a",
        "android_client_info": {
          "package_name": "com.example.ff.crashrep1"
        }
      },
      "oauth_client": [
        {
          "client_id": "484954907583-c3f2jv9eng4r4h6chlf33a6oc0s4hptl.apps.googleusercontent.com",
          "client_type": 3
        }
      ],
      "api_key": [
        {
          "current_key": "AIzaSyDdlwnNGtv6RHo55xN7lxpuSrTh6MFss7k"
        }
      ],
      "services": {
        "analytics_service": {
          "status": 1
        },
        "appinvite_service": {
          "status": 2,
          "other_platform_oauth_client": [
            {
              "client_id": "484954907583-c3f2jv9eng4r4h6chlf33a6oc0s4hptl.apps.googleusercontent.com",
              "client_type": 3
            }
          ]
        },
        "ads_service": {
          "status": 2
        }
      }
    }
  ],
  "configuration_version": "1"
} 

2) My project settings in firebase console:

enter image description here

3) My simple activity:

public class MainActivity extends AppCompatActivity {


    private static final String TAG = "MainActivity";

    private TextView mTextView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


        FirebaseCrash.log("Activity created");



        try {
            mTextView.setText("some text");
        }
        catch (NullPointerException e)
        {
            Log.d(TAG, "Exception");
            FirebaseCrash.logcat(Log.ERROR, TAG, "NPE caught");
            FirebaseCrash.report(e);
        }


    }
}

4) My manifest file:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.example.ff.crashrep1">


    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>

                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
    </application>

</manifest>

5) My project tree directories:

enter image description here

In the Json file field

"current_key": "AIzaSyDdlwnNGtv6RHo55xN7lxpuSrTh6MFss7k"

different from key in firebase console settings:

AIzaSyCGmjhNuovZQkQfmBKGcEj4KT4X9a0GFqo

I try to set both api keys in my project

AIzaSyDdlwnNGtv6RHo55xN7lxpuSrTh6MFss7k and AIzaSyCGmjhNuovZQkQfmBKGcEj4KT4X9a0GFqo

but it didn't help me.

I try set all thing but nothing help. I don't know why firebase dosn't react on my FirebaseCrash.report command.

I repeat, my android device registered in google. But I don't have my application in google play.

What did I do wrong in my project ?

1

There are 1 answers

0
Yogesh Dube On

First thing firebase crash report can works with both the case of USB debugging and install from play store.

So, First check whether your app generating exception or not otherwise it will not show You on firebase console.

And you dont need to change any key in your Json file ,keep that json file as it is downloaded from firebase console for the testing purpose.

You can test your app with this following code: Its working for my app

 try
        {
            int a = 12/0;
        }
        catch(Exception e)
        {
              FirebaseCrash.report(new Exception("My first Android non-fatal error"+e));
        }