无法启动活动ComponentInfo。 java.lang.NullPointerException:不存在Firestore组件

时间:2018-09-04 10:41:01

标签: android firebase google-cloud-firestore

我在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:

https://pastebin.com/k7e0Vzy4

PROJECT build.gradle:

https://pastebin.com/hMjwpAK9

有什么建议吗?

1 个答案:

答案 0 :(得分:0)

在获得实例之前先使用Firebase初始化应用

IocManager.Register(
       typeof(IStatementsDetailService<>),
       typeof(StatementsDetailBaseService<>),
       DependencyLifeStyle.Transient);