Google cloud firestore FirestoreException-找不到TLS ALPN提供程序-无法正常工作

Google cloud firestore FirestoreException-找不到TLS ALPN提供程序-无法正常工作,google-cloud-firestore,netty,alpn,Google Cloud Firestore,Netty,Alpn,我有一个用Java/Kotlin制作的带有Firebase(特别是Firestore realtime)连接的桌面应用程序 它在我的笔记本电脑(Windows通过Parallels)和其他一些Windows测试中正常工作。但是,在某些电脑中,我总是会遇到一个错误: com.google.cloud.firestore.FirestoreException:java.lang.IllegalStateException:找不到TLS ALPN提供程序;没有可用的netty tcnative、Con

我有一个用Java/Kotlin制作的带有Firebase(特别是Firestore realtime)连接的桌面应用程序

它在我的笔记本电脑(Windows通过Parallels)和其他一些Windows测试中正常工作。但是,在某些电脑中,我总是会遇到一个错误:

com.google.cloud.firestore.FirestoreException:java.lang.IllegalStateException:找不到TLS ALPN提供程序;没有可用的netty tcnative、Conscrypt或Jetty NPN/ALPN

我尝试了一些罐子的创作变化,但没有任何帮助

这是我当前的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"
}

我对Firebase Firestore也有同样的问题(在Java服务器应用程序中,没有android),它与Java版本有关

我使用的是openjdk 8u191-jre-alpine3.9,在切换到openjdk 13-ea-16-jdk-alpine3.9之后,它被修复了


p.D:在Google上搜索时,我发现了一些关于为grpc、netty等添加依赖项的条目,但它们对我不起作用。

每个人都在说要添加库,我的应用程序在通过IDE运行时在Netbeans中运行良好。。但是当我通过Launch4J编译一个.EXE文件时,它不断抛出这个异常。。。我将自己的JRE/JDK提供给.EXE包装器

我读了又读。。某处有人说更新java。。。我有Java1.8,但它是从2018年1月开始的,或者类似的东西。。我更新了最新的Java 1.8 JDK,以获取我以.EXE包装形式提供给我的应用程序的内容,以及walla。。它起作用了!Firestore中没有tcnative TLS异常


希望这有帮助

我在Docker容器中启动FireBase应用程序时遇到了相同的问题

在我的例子中,我不得不将基本映像从openjdk:8-jdk-alpine更改为openjdk:8

资料来源: