gpt4 book ai didi

android - 带有错误trustAnchors参数的Android Studio 4.X.1必须为非空

转载 作者:行者123 更新时间:2023-12-03 06:28:23 26 4
gpt4 key购买 nike

伙计们,我已经开始使用电容器在Ionic上进行Stater项目。尝试构建Android构建,似乎Android Studio因Gradle问题而失败。
我在下面做了
ionic 电容器运行android
我的build.gradle文件

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

repositories {
google()
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.1'
classpath 'com.google.gms:google-services:4.3.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

apply from: "variables.gradle"

allprojects {
repositories {
google()
mavenCentral()
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
问题:
Executing tasks: [build] in project /somelocation/android


FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:3.6.1.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:3.6.1.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.6.1/gradle-3.6.1.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.6.1/gradle-3.6.1.pom'.
> java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
> Could not resolve com.android.tools.build:gradle:3.6.1.
> Could not get resource 'https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/3.6.1/gradle-3.6.1.pom'.
> Could not GET 'https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/3.6.1/gradle-3.6.1.pom'.
> java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
> Could not resolve com.android.tools.build:gradle:3.6.1.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.6.1/gradle-3.6.1.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.6.1/gradle-3.6.1.pom'.
> java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
> Could not resolve com.google.gms:google-services:4.3.3.
Required by:
project :
> Could not resolve com.google.gms:google-services:4.3.3.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.3.3/google-services-4.3.3.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.3.3/google-services-4.3.3.pom'.
> java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
> Could not resolve com.google.gms:google-services:4.3.3.
> Could not get resource 'https://repo.maven.apache.org/maven2/com/google/gms/google-services/4.3.3/google-services-4.3.3.pom'.
> Could not GET 'https://repo.maven.apache.org/maven2/com/google/gms/google-services/4.3.3/google-services-4.3.3.pom'.
> java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
> Could not resolve com.google.gms:google-services:4.3.3.
> Could not get resource 'https://jcenter.bintray.com/com/google/gms/google-services/4.3.3/google-services-4.3.3.pom'.
> Could not GET 'https://jcenter.bintray.com/com/google/gms/google-services/4.3.3/google-services-4.3.3.pom'.
> java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

* 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 https://help.gradle.org

BUILD FAILED in 436ms
22:23:51: Task execution finished 'build'.
我可以使用Ionic命令构建项目,但是我想在模拟器上运行它,因此尝试在Android Studio上打开它。当我尝试使用android studio gradle同步导入时,发生以上异常。在这个问题上的任何方向都将有所帮助。

最佳答案

解决了。当我运行带有OpenJDK版本openjdk-8u41-b04-linux-x64-14_jan_2020的项目时,发生此错误。一旦将其更改为使用OpenJDK 14.0.2,它就可以正常工作。

关于android - 带有错误trustAnchors参数的Android Studio 4.X.1必须为非空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64234117/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com