java - 不允许解析依赖配置“实现”,因为它被定义为“canBeResolved=false”
问题描述
我正在尝试运行一个反应原生项目,但它的 gradle 无法正常工作。这是错误。
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':babylonjs_react-native'.
Caused by: java.lang.IllegalStateException: Resolving dependency configuration 'implementation' is not allowed as it is defined as 'canBeResolved=false'.
Instead, a resolvable ('canBeResolved=true') dependency configuration that extends 'implementation' should be resolved.
at build_8wyks54mb6cye9xs3jcg9t1xg$_run_closure4$_closure12.doCall(G:\Workspace\New Folder (2)\node_modules\@babylonjs\react-native\android\build.gradle:117)
at build_8wyks54mb6cye9xs3jcg9t1xg$_run_closure4.doCall(G:\Workspace\New Folder (2)\node_modules\@babylonjs\react-native\android\build.gradle:114)
这是问题发生的地方
afterEvaluate { project ->
// some Gradle build hooks ref:
// https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html
task androidJavadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += files(android.bootClasspath)
classpath += files(project.getConfigurations().getByName('implementation').asList())
include '**/*.java'
}
请有人告诉我为什么错误显示我不知道发生了什么。有人请帮助我,我将非常感激。
解决方案
您应该使用下面的代码:
classpath += files(configurations.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it) })
这可能对你有帮助。
推荐阅读
- python - 如何使用函数参数过滤函数输出
- express - vhost 正在继承其他路由
- angular - 从 NgRX 效果更新状态集合/数组的 Action 和 Reducer 语法是什么?
- python - 如何通过 Python 3.5 将 base64 图像嵌入 HTML 电子邮件?
- moodle - Moodle 角色权限 'mod/certificate:manage' 它赋予什么能力?
- nagios - 用“&&”定义nagios命令
- bash - Bash - 评估两个环境变量时出现错误替换错误
- eclipse - Apache Tomcat 服务器无法在 localhost 中运行
- android - Android rx Java对SwitchMap的误解,得到意想不到的结果
- kubernetes - kubectl 请输入用户名:错误:EOF