admin管理员组

文章数量:1022769

I generated a Flutter plugin with the following command:

flutter create --template=plugin --platforms=android,ios new_plug

When I execute the plugin I am getting below as the exception.

Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not resolve androidx.test:runner:1.2+.
     Required by:
         project :app > project :integration_test
      > Failed to list versions for androidx.test:runner.
         > Unable to load Maven meta-data from .xml.
            > Could not HEAD '.xml'.
               > Got SSL handshake exception during request. It might be caused by SSL misconfiguration
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Failed to list versions for androidx.test:runner.
         > Unable to load Maven meta-data from .xml.
            > Could not HEAD '.xml'.
               > Got SSL handshake exception during request. It might be caused by SSL misconfiguration
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   > Could not resolve androidx.test:rules:1.2+.
     Required by:
         project :app > project :integration_test
      > Failed to list versions for androidx.test:rules.
         > Unable to load Maven meta-data from .xml.
            > Could not HEAD '.xml'.
               > Got SSL handshake exception during request. It might be caused by SSL misconfiguration
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Failed to list versions for androidx.test:rules.
         > Unable to load Maven meta-data from .xml.
            > Could not HEAD '.xml'.
               > Got SSL handshake exception during request. It might be caused by SSL misconfiguration
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   > Could not resolve androidx.test.espresso:espresso-core:3.2+.
     Required by:
         project :app > project :integration_test
      > Failed to list versions for androidx.test.espresso:espresso-core.
         > Unable to load Maven meta-data from .xml.
            > Could not HEAD '.xml'.
               > Got SSL handshake exception during request. It might be caused by SSL misconfiguration
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Failed to list versions for androidx.test.espresso:espresso-core.
         > Unable to load Maven meta-data from .xml.
            > Could not HEAD '.xml'.
               > Got SSL handshake exception during request. It might be caused by SSL misconfiguration
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at .

BUILD FAILED in 34s
Error: Gradle task assembleDebug failed with exit code 1

Project Structure is below:

Click to view project structure

What I have tried till now:

  1. I have tried creating a new file named gradle.properties under the android folder and put the below line in it. The android directory was at the same level as the example directory.
systemProp.gradle.internal.http.connectionTimeout=60000
systemProp.gradle.internal.http.socketTimeout=60000
systemProp.gradle.internal.http.sslVerify=false

Versions Info:

  1. Android Studio Koala 2024.1.1
  2. Android SDK 14.0 API level 34

Thank you for helping in advance :)

I generated a Flutter plugin with the following command:

flutter create --template=plugin --platforms=android,ios new_plug

When I execute the plugin I am getting below as the exception.

Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not resolve androidx.test:runner:1.2+.
     Required by:
         project :app > project :integration_test
      > Failed to list versions for androidx.test:runner.
         > Unable to load Maven meta-data from .xml.
            > Could not HEAD '.xml'.
               > Got SSL handshake exception during request. It might be caused by SSL misconfiguration
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Failed to list versions for androidx.test:runner.
         > Unable to load Maven meta-data from .xml.
            > Could not HEAD '.xml'.
               > Got SSL handshake exception during request. It might be caused by SSL misconfiguration
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   > Could not resolve androidx.test:rules:1.2+.
     Required by:
         project :app > project :integration_test
      > Failed to list versions for androidx.test:rules.
         > Unable to load Maven meta-data from .xml.
            > Could not HEAD '.xml'.
               > Got SSL handshake exception during request. It might be caused by SSL misconfiguration
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Failed to list versions for androidx.test:rules.
         > Unable to load Maven meta-data from .xml.
            > Could not HEAD '.xml'.
               > Got SSL handshake exception during request. It might be caused by SSL misconfiguration
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   > Could not resolve androidx.test.espresso:espresso-core:3.2+.
     Required by:
         project :app > project :integration_test
      > Failed to list versions for androidx.test.espresso:espresso-core.
         > Unable to load Maven meta-data from .xml.
            > Could not HEAD '.xml'.
               > Got SSL handshake exception during request. It might be caused by SSL misconfiguration
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Failed to list versions for androidx.test.espresso:espresso-core.
         > Unable to load Maven meta-data from .xml.
            > Could not HEAD '.xml'.
               > Got SSL handshake exception during request. It might be caused by SSL misconfiguration
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at .

BUILD FAILED in 34s
Error: Gradle task assembleDebug failed with exit code 1

Project Structure is below:

Click to view project structure

What I have tried till now:

  1. I have tried creating a new file named gradle.properties under the android folder and put the below line in it. The android directory was at the same level as the example directory.
systemProp.gradle.internal.http.connectionTimeout=60000
systemProp.gradle.internal.http.socketTimeout=60000
systemProp.gradle.internal.http.sslVerify=false

Versions Info:

  1. Android Studio Koala 2024.1.1
  2. Android SDK 14.0 API level 34

Thank you for helping in advance :)

本文标签: kotlinSSL Handshake Exception When Building Flutter PluginStack Overflow