У меня ошибка при компиляции кода для администратора Firebase.
Ошибка:
![enter image description here](https://i.stack.imgur.com/6Sht7.png)
Следуя информации из http://www.slf4j.org/codes.html#StaticLoggerBinder Я пробовал добавлять все зависимости одну за другой
добавляя
testCompile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.13.3'
или
testCompile group: 'org.slf4j', name: 'slf4j-nop', version: '1.8.0-beta4'
или
testCompile group: 'org.slf4j', name: 'slf4j-simple', version: '1.8.0-beta4'
или
testCompile group: 'org.slf4j', name: 'slf4j-jdk14', version: '1.8.0-beta4'
или
testCompile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
не устраняет ошибку. Могу ли я узнать, с чем я ошибаюсь?
Мой файл Gradle:
plugins {
id 'java'
}
group 'org.example'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
implementation 'com.google.firebase:firebase-admin:6.13.0'
//None of these seem to remove the error
// testCompile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.13.3'
// testCompile group: 'org.slf4j', name: 'slf4j-nop', version: '1.8.0-beta4'
// testCompile group: 'org.slf4j', name: 'slf4j-simple', version: '1.8.0-beta4'
// testCompile group: 'org.slf4j', name: 'slf4j-jdk14', version: '1.8.0-beta4'
// testCompile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
Мой основной класс
import com.google.auth.oauth2.GoogleCredentials;
import com.google.firebase.FirebaseApp;
import com.google.firebase.FirebaseOptions;
import com.google.firebase.database.*;
import java.io.IOException;
public class MainClass {
public static void main(String[] args) throws IOException {
FirebaseOptions options = new FirebaseOptions.Builder()
.setCredentials(GoogleCredentials.getApplicationDefault())
.setDatabaseUrl("https://{my database name}.firebaseio.com/")
.build();
FirebaseApp.initializeApp(options);
DatabaseReference ref = FirebaseDatabase.getInstance()
.getReference("restricted_access/secret_document");
ref.setValue("hiIII", new DatabaseReference.CompletionListener() {
@Override
public void onComplete(DatabaseError error, DatabaseReference ref) {
System.out.println("Completed");
}
});
}
}
Могу ли я узнать, что я собираюсь что-то плохо с чем-то? и как это исправить?