java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState
See original GitHub issueHere is my code
FileInputStream serviceAccount = new FileInputStream("firebase.json");
FirebaseOptions options = new FirebaseOptions.Builder()
.setCredential(FirebaseCredentials.fromCertificate(serviceAccount))
.setDatabaseUrl("https://xxxxx.firebaseio.com/")
.build();
FirebaseApp.initializeApp(options);
FirebaseAuth.getInstance();
FirebaseAuth.getInstance();
causing the issue. The error log stack is here
Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;)V
at com.google.firebase.FirebaseApp.checkNotDeleted(FirebaseApp.java:314)
at com.google.firebase.FirebaseApp.getOptions(FirebaseApp.java:260)
at com.google.firebase.auth.FirebaseAuth.<init>(FirebaseAuth.java:74)
at com.google.firebase.auth.FirebaseAuth.<init>(FirebaseAuth.java:61)
at com.google.firebase.auth.FirebaseAuth.<init>(FirebaseAuth.java:52)
at com.google.firebase.auth.FirebaseAuth$FirebaseAuthService.<init>(FirebaseAuth.java:316)
at com.google.firebase.auth.FirebaseAuth.getInstance(FirebaseAuth.java:98)
at com.google.firebase.auth.FirebaseAuth.getInstance(FirebaseAuth.java:85)
at com.datasignstech.lam.core.google.GoogleInterface.main(GoogleInterface.java:119)
I am not sure why I am getting the above error. I see the code and at FirebaseApp.java:314 it is passing 3 arguments, but in error it is showing only two arguments, which is not there in Preconditions. Kindly help me in this.
I am using firebase-admin sdk: 5.2.0 Jdk: 1.8.0 OS: Ubuntu 16.04
Issue Analytics
- State:
- Created 6 years ago
- Comments:21 (5 by maintainers)
Top Results From Across the Web
5 - Stack Overflow
java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;) with Selenium, gradle and ChromeDriver.
Read more >Issues - GitHub
lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/ ...
Read more >Java.lang.NoSuchMethodError is throwing | Selenium Forum
Java.lang.NoSuchMethodError is throwing .Throwing the below error while executing the program, Attached the pom.xml file used to compile ...
Read more >[selenium-users] java.lang.NoSuchMethodError: com.google ...
Im getting this error. java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/ ...
Read more >java.lang.NoSuchMethodError: com.google ... - Google Groups
java.lang.NoSuchMethodError: com.google.common.base.Preconditions ... checkState(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Code below should fix this issue.
maven solution example