[英]Kotlin build not building with fresh console application project using gradle Intellij
I have created my simple project using Intellij Idea wizard set up to create a Kotlin console Application but seems like Gradle sync is not working (the project is not even builded).我已经使用 Intellij Idea 向导创建了我的简单项目,该向导设置为创建 Kotlin 控制台应用程序,但似乎 Gradle 同步不起作用(甚至没有构建项目)。 I tried many solutions which I found on the internet.
我尝试了许多在互联网上找到的解决方案。
I work with Android studio and android development.我与 Android 工作室和 android 开发合作。 Is it possible they to mess configurations between them?
他们有可能在他们之间搞乱配置吗? On Android Studio, I don't have problems with working and configuring the Android Kotlin projects.
在 Android Studio 上,我在工作和配置 Android Kotlin 项目方面没有问题。
Can I ask for some advice on what to do next?我可以就下一步做什么寻求一些建议吗? I am sure, that I missing something ridiculous.
我敢肯定,我错过了一些荒谬的东西。 Or can you give me some template code for Gradle Kotlin?
或者你能给我一些 Gradle Kotlin 的模板代码吗?
I really want to start to write project code.我真的很想开始写项目代码。
Thank you very much in advance:)非常感谢您提前:)
Here is the build error:这是构建错误:
A problem occurred configuring root project 'MyProject'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib:1.4.20.
Required by:
project :
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib:1.4.20.
> Could not get resource 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-stdlib/1.4.20/kotlin-stdlib-1.4.20.pom'.
> Could not GET 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-stdlib/1.4.20/kotlin-stdlib-1.4.20.pom'.
> java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
> Could not resolve org.jetbrains.kotlin:kotlin-reflect:1.4.20.
Required by:
project :
> Could not resolve org.jetbrains.kotlin:kotlin-reflect:1.4.20.
> Could not get resource 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-reflect/1.4.20/kotlin-reflect-1.4.20.pom'.
> Could not GET 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-reflect/1.4.20/kotlin-reflect-1.4.20.pom'.
> java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-common:1.4.20.
Required by:
project :
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-common:1.4.20.
> Could not get resource 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-stdlib-common/1.4.20/kotlin-stdlib-common-1.4.20.pom'.
> Could not GET 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-stdlib-common/1.4.20/kotlin-stdlib-common-1.4.20.pom'.
> java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib:1.4.20.
Required by:
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.5.0 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.5.0 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0 > org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.5.0
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.5.0 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0 > org.jetbrains.kotlin:kotlin-gradle-plugin-model:1.5.0
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.5.0 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0 > org.jetbrains.kotlin:kotlin-util-klib:1.5.0
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.5.0 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0 > org.jetbrains.kotlin:kotlin-compiler-embeddable:1.5.0
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.5.0 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0 > org.jetbrains.kotlin:kotlin-annotation-processing-gradle:1.5.0
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.5.0 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0 > org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.5.0
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.5.0 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0 > org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.5.0
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.5.0 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0 > org.jetbrains.kotlin:kotlin-util-klib:1.5.0 > org.jetbrains.kotlin:kotlin-util-io:1.5.0
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.5.0 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0 > org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.5.0 > org.jetbrains.kotlin:kotlin-scripting-common:1.5.0
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.5.0 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0 > org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.5.0 > org.jetbrains.kotlin:kotlin-scripting-jvm:1.5.0
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib:1.4.20.
> Could not get resource 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-stdlib/1.4.20/kotlin-stdlib-1.4.20.pom'.
> Could not GET 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-stdlib/1.4.20/kotlin-stdlib-1.4.20.pom'.
> java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
> Could not resolve org.jetbrains.kotlin:kotlin-reflect:1.4.20.
Required by:
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.5.0 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.5.0 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0 > org.jetbrains.kotlin:kotlin-compiler-embeddable:1.5.0
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.5.0 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0 > org.jetbrains.kotlin:kotlin-compiler-runner:1.5.0 > org.jetbrains.kotlin:kotlin-daemon-client:1.5.0
> Could not resolve org.jetbrains.kotlin:kotlin-reflect:1.4.20.
> Could not get resource 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-reflect/1.4.20/kotlin-reflect-1.4.20.pom'.
> Could not GET 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-reflect/1.4.20/kotlin-reflect-1.4.20.pom'.
> java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib:1.4.20.
Required by:
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.5.0 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0 > org.jetbrains.kotlin:kotlin-compiler-runner:1.5.0 > org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.8
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib:1.4.20.
> Could not get resource 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-stdlib/1.4.20/kotlin-stdlib-1.4.20.pom'.
> Could not GET 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-stdlib/1.4.20/kotlin-stdlib-1.4.20.pom'.
> java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-common:1.4.20.
Required by:
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.5.0 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0 > org.jetbrains.kotlin:kotlin-compiler-runner:1.5.0 > org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.8
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-common:1.4.20.
> Could not get resource 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-stdlib-common/1.4.20/kotlin-stdlib-common-1.4.20.pom'.
> Could not GET 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-stdlib-common/1.4.20/kotlin-stdlib-common-1.4.20.pom'.
> java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
* Run with --scan
> * Where:
> Auto-applied by using --scan
> What went wrong:
>Plugin [id: 'com.gradle.enterprise', version: '3.5', artifact: 'com.gradle:gradle-enterprise-gradle-plugin:3.5'] was >not found in any of the following sources:
>- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
>- Plugin Repositories (could not resolve plugin artifact 'com.gradle:gradle-enterprise-gradle-plugin:3.5')
> Searched in the following repositories:
> Gradle Central Plugin Repository
EDIT: Look I have corrupted the Project tree.编辑:看我已经损坏了项目树。 I tried to create again project and I again see something strange in the Project file tree view
我尝试再次创建项目,但在项目文件树视图中再次看到一些奇怪的东西
EDIT 2: as you see in EDIT 1: something is really strange.编辑 2:正如您在编辑 1 中看到的那样:有些东西真的很奇怪。 For that, I add another picture where I show another project with similar problems ( I made maybe 10, and I always have some kind of similar problems ).
为此,我添加了另一张图片,其中展示了另一个有类似问题的项目(我做了大概 10 个,而且我总是遇到一些类似的问题)。 I am so confused:/
我感到很困惑:/
EDIT 3:
编辑 3:
I tried with a different JDK - I changed it to Adobe Open Jdk and the problem was solved.我尝试使用不同的 JDK - 我将其更改为 Adobe Open Jdk,问题就解决了。 Thank you:)
谢谢:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.