在尝试在 Kotlin Multiplatform Mobile 中运行 CommonTest 时出现错误。

huangapple go评论65阅读模式
英文:

Getting error when trying to run Test in CommonTest in Kotlin Multiplatform Mobile

问题

在尝试在Kotlin Multiplatform Mobile项目的CommonTest中运行测试时,我总是收到以下错误消息:

在尝试运行Kotlin Multiplatform Mobile项目的CommonTest中的测试时,总是收到以下错误消息:

Build file '/Users/rageshantonyd/Documents/working_prj/current/livestock-mobile/MobileSharedLib/build.gradle.kts' line: 1

* 出现了什么问题:
在以下来源中找不到插件[id: 'com.android.library',版本:'7.4.2']:
    
- Gradle核心插件(插件不在'org.gradle'命名空间中)
- 插件仓库(无法解析插件构件'com.android.library:com.android.library.gradle.plugin:7.4.2')
  在以下仓库中搜索:
    Gradle中央插件仓库

为什么会出现这个错误?请帮助我。

我的gradle文件:

https://gist.github.com/RageshAntony/22112e322945617faf8cf01073e8a442

英文:

Getting 'Plugin [id: 'com.android.library', version: '7.4.2'] was not found in any of the following sources: ' error when trying to run Test in CommonTest in Kotlin Multiplatform Mobile
When I am trying to run Test in CommonTest in Kotlin Multiplatform Mobile project, I always get this error:

Build file '/Users/rageshantonyd/Documents/working_prj/current/livestock-mobile/MobileSharedLib/build.gradle.kts' line: 1
    
* What went wrong:
Plugin [id: 'com.android.library', version: '7.4.2'] 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.android.library:com.android.library.gradle.plugin:7.4.2')
  Searched in the following repositories:  
    Gradle Central Plugin Repository

Why ? Please help me

My gradle files :

https://gist.github.com/RageshAntony/22112e322945617faf8cf01073e8a442

答案1

得分: 2

你的错误信息显示该插件仅在 Gradle 插件中心搜索。

然而,Android Gradle 插件不在该仓库中可用。

你在 pluginManagement { repositories { ... } } 部分遗漏了 google() 仓库,该仓库中包含该插件。

英文:

Your error message shows that the plugin is only searched Gradle plugin central.

The Android Gradle plugins is not available in that repository though.

You miss the google() repository in our pluginManagement { repositories { ... } } section where the plugin is present.

huangapple
  • 本文由 发表于 2023年6月25日 19:53:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/76550263.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定