发生异常“ com.google.cloud.firestore.FirestoreException:java.lang.IllegalStateException:找不到TLS ALPN提供程序;没有可用的netty-tcnative,Conscrypt或Jetty NPN / ALPN”
关于代码,
InputStream serviceAccount = new FileInputStream("json file path");
GoogleCredentials credentials = GoogleCredentials.fromStream(serviceAccount);
FirebaseOptions options = new FirebaseOptions.Builder()
.setCredentials(credentials)
.build();
FirebaseApp.initializeApp(options);
Firestore db = FirestoreClient.getFirestore();
我的pom.xml:
<dependencies>
<dependency>
<groupId>com.google.firebase</groupId>
<artifactId>firebase-admin</artifactId>
<version>6.7.0</version>
</dependency>
</dependencies>