我有一个用Firebase(特别是Firestore实时)连接以Java / Kotlin制作的桌面应用程序。
它可以在我的笔记本电脑(通过Parallels的Windows)中正常运行,并且在其他经过Windows测试的系统中也可以正常运行。但是,在某些电脑中,我总是会出错:com.google.cloud.firestore.FirestoreException: java.lang.IllegalStateException: Could not find TLS ALPN provider; no working netty tcnative, Conscrypt, or Jetty NPN/ALPN available
。
我尝试了一些jar的创作变化,但没有任何帮助。
这是我当前的build.gradle连接:
plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.3.21'
}
jar {
manifest {
attributes 'Main-Class': 'main.LoginActivity'
}
}
// java -cp Y:\Desktop\nwebprint\out\artifacts\nwebprint_main_jar\nwebprint.main.jar main.LoginActivity
group 'nwebprint'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
version = '1.0'
sourceCompatibility = 1.7
targetCompatibility = 1.7
//create a single Jar with all dependencies
task fatJar(type: Jar) {
manifest {
attributes 'Implementation-Title': 'Notary Web Service',
'Implementation-Version': version,
'Main-Class': 'main.LoginActivity'
}
baseName = project.name + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
testCompile group: 'junit', name: 'junit', version: '4.12'
compile ('com.google.firebase:firebase-admin:6.8.0') {
exclude( group: 'com.google.guava')
}
compile 'com.google.guava:guava:20.0'
// compile 'io.grpc:grpc-netty-shaded'
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
最佳答案
在Docker容器中启动FireBase应用程序时遇到了同样的问题。
就我而言,我必须更改基本映像-从openjdk:8-jdk-alpine更改为openjdk:8
来源:https://gitmemory.com/issue/grpc/grpc-java/5369/493463266