0

Am trying to set up a firebase admin server,when i try to run it,it shows this error

java: cannot access com.google.auth.Credentials class file for com.google.auth.Credentials not found

Is there someone who can help me fix this error?

Am using IntelliJ

public class server {

    public static final String UID = "Some-uid";

    public static void main (String [] args) throws IOException, ExecutionException, InterruptedException {

        FileInputStream serviceAccount = new FileInputStream("./example.json");

        FirebaseOptions options = new FirebaseOptions.Builder()
                .setCredentials(GoogleCredentials.fromStream(serviceAccount))
                .setDatabaseUrl("https://example.firebaseio.com/")
                .build();

        FirebaseApp.initializeApp(options);
        String customtoken = FirebaseAuth.getInstance().createCustomTokenAsync(UID).get();
        System.out.println(customtoken);
    }
}

Thanks in advance!

V-rund Puro-hit
  • 5,518
  • 9
  • 31
  • 50
Wojuola Ayotola
  • 608
  • 8
  • 16

0 Answers0