我有一个用 Java/Kotlin 制作的桌面应用程序,带有 Firebase(特别是 Firestore 实时)连接。
它在我的笔记本(通过 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"
}