我在Android上使用Firebase,并且尝试通过以下方式实例化Firestore:
FirebaseFirestore rootRef = FirebaseFirestore.getInstance()
但是我得到了空指针异常
p.s .:如果我不实例化FirebaseApp
FirebaseApp.initializeApp(this)), I get the error: "java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process. Make sure to call FirebaseApp.initializeApp(Context) first.
[编辑]
APP build.gradle:
PROJECT build.gradle:
有什么建议吗?
答案 0 :(得分:0)
在获得实例之前先使用Firebase初始化应用
IocManager.Register(
typeof(IStatementsDetailService<>),
typeof(StatementsDetailBaseService<>),
DependencyLifeStyle.Transient);