Firebase Crash reporting for alpha & beta

680 views Asked by At

I'm finishing my first android app but I want to start with an Alpha & Beta test in the playstore. This is how I have my firebase setup

  • 1 Firebase Project:
    • 4 Firebase Android apps:
      • 1 with package name com.myapp.appname.alpha
      • 1 with package name com.myapp.appname.beta
      • 1 with package name com.myapp.appname
      • 1 with package name com.myapp.appname.dev

I have done it this way so the release & dev crash reports are separated. I thought, I do the same thing for alpha & beta. But apparently I can't upload an alpha & beta & release with different package names these are my buildtypes.

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }

    debug {
        versionNameSuffix '-DEV'
        applicationIdSuffix ".dev"
    }

    beta {
        applicationIdSuffix ".beta"
        versionNameSuffix '-BETA'
    }

    alpha {
        applicationIdSuffix ".alpha"
        versionNameSuffix '-ALPHA'
    }
}

After I saw that this doesn't work I tried to change some thing to identify different builttypes like this. (this string packagename is just for information) (still no solution to my problem)

buildTypes {
    release {
        resValue 'string', 'packagename', 'com.myapp.appname'
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }

    debug {
        resValue 'string', 'packagename', 'com.myapp.appname.dev'
        versionNameSuffix '-DEV'
        applicationIdSuffix ".dev"
    }

    beta {
        resValue 'string', 'packagename', 'com.myapp.appname.beta'
        versionNameSuffix '-BETA'
    }

    alpha {
        resValue 'string', 'packagename', 'com.myapp.appname.alpha'
        versionNameSuffix '-ALPHA'
    }
}

So my question is how can I receive the crash reports of the alpha & beta buildtype in another firebase Android app?

My Solution ATM

after the information @Doug Stevenson gave me. I figured a way how I can handle the alpha, beta, release and dev build.

1 Firebase Project for:

  • 1 Android for Release, Beta, Alpha

1 Firebase Project for:

  • Dev Android App

Now, I will still get all the crashes of the alpha, beta, release in 1 Report, because the playstore doesn't support multiple packagenames, and firebase does not support any other way of registering your app. So I have done 2 things to identify what on version the crash appeared.

No 1: I gave each productflavor another version suffix. and an extra string app_version

defaultConfig {
    applicationId "com.myapp.appname"
}

buildTypes {
    release {
        resValue 'string', 'app_version', 'prod'
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    debug {
        resValue 'string', 'app_version', 'dev'
        versionNameSuffix '-DEV'
        applicationIdSuffix ".dev"
    }

    beta {
        resValue 'string', 'app_version', 'beta'
        versionNameSuffix '-BETA'
    }

    alpha {
        resValue 'string', 'app_version', 'alpha'
        versionNameSuffix '-ALPHA'
    }
}

No 2: I Added a applicationIdSuffix for the dev application (see above). This way I can create another firebase project with an unique packagename. so my dev data & prod data are separated.

No 3: I wrote my on application to initialize a log when the application starts, so If something happens this is the last log I see in the firebase crash report logcat.

public class MidiMacro extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        FirebaseCrash.log(String.format("%S      ----->      Android Version", getString(R.string.app_version)));
    }
}
1

There are 1 answers

12
Doug Stevenson On

The Firebase team has always recommended that the same app in different environments (dev, alpha, beta, prod, etc) is best accomplished by having a different project for each one. That keeps them completely isolated from each other, so if you mess something up in dev, it doesn't affect your prod users. Read my blog post about this for a complete discussion.