Код: Выделить всё
private FirebaseApp getFirebaseApp(final String serverKeyJson, final String projectId) throws IOException {
for (final FirebaseApp app : FirebaseApp.getApps()) {
if (app.getOptions().getProjectId().equals(projectId)) {
return app;
}
}
final ByteArrayInputStream credentialsStream = new ByteArrayInputStream(serverKeyJson.getBytes());
final FirebaseOptions options = FirebaseOptions.builder()
.setCredentials(GoogleCredentials.fromStream(credentialsStream))
.setProjectId(projectId)
.build();
return FirebaseApp.initializeApp(options, projectId);
}
Как решить эту проблему?
Подробнее здесь: https://stackoverflow.com/questions/786 ... ady-exists