android - Firebase init fails when running tests in androidTest -
i have app splitten modules support instant app feature. app uses firebase
.
the app uses firebase
in application.oncreate()
callback (on startup). when try run tests in androidtest
, app crashes.
i put logging , discovered, app runs different process name when run normally, , test:
class app : application() { override fun oncreate() { super.oncreate() firebaseapp.initializeapp(this) // com.mypackage.app when run normal app // com.mypackage.app.test when running tests log.d(tag, "running process name: " + processname(this)) // crashes process under test val token = firebaseinstanceid.getinstance().token log.d(tag, "instance token: " + token) } }
i can observe firebase
error message when running test suite:
09-10 13:46:00.533 17360-17360/com.mypackage.app.test i/firebaseinitprovider: firebaseapp initialization unsuccessful
my google-services.json
uses defines com.mypackage.app
, guess problem.
is there way have firebase
-related code in application
, still beingn able run tests?
Comments
Post a Comment