英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论