I am quite new to Java and I am currently trying to use the Firebase Admin SDK with my application.
I am using Eclipse with the Maven plugin.
I have included this dependency in my Maven pom.xml file
<dependency>
<groupId>com.google.firebase</groupId>
<artifactId>firebase-admin</artifactId>
<version>4.0.3</version>
</dependency>
After that, I made a new application under src/main/java and I tried to initialize the SDK with the code below, as the official Google Document asked me to.
package com.vogella.maven.quickstart;
import com.google.firebase.FirebaseOptions;
public class App {
public static void main( String[] args )
{
/*Firebase SDKをinitializeするために*/
FirebaseOptions options = new FirebaseOptions.Builder();
} }
However, I am getting an error saying that I have to change the code to
Builder options = new FirebaseOptions.Builder()
Is the Google official document wrong?
Looks like you didn't copy the rest of the code
Your error is that obviously a
FirebaseOptions
class cannot be assigned to anew FirebaseOptions.Builder()
.You must
build()
theBuilder