gpt4 book ai didi

android - 无法将提供的符号转换为文件或 URI

转载 作者:行者123 更新时间:2023-11-29 15:33:58 25 4
gpt4 key购买 nike

运行 espresso 测试时出现以下错误 ./gradlewconnectedAndroidTest

> Task :app:fixStackFramesLiveDebugAndroidTest FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:fixStackFramesLiveDebugAndroidTest'.
> Cannot convert the provided notation to a File or URI: classes.jar (androidx.databinding:databinding-adapters:3.4.1).
The following types/formats are supported:
- A String or CharSequence path, for example 'src/main/java' or '/usr/include'.
- A String or CharSequence URI, for example 'file:/usr/include'.
- A File instance.
- A Path instance.
- A Directory instance.
- A RegularFile instance.
- A URI or URL instance.

app/build.gradle 包含以下内容

...
android {
.....
defaultConfig {
...
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
...
}
dataBinding {
enabled = true
}
}
...

无论 Espresso 依赖性如何,我都会收到上述错误。有人可以帮助解决这个问题吗?我是 Android 和 espresso 的新手。我不确定我是否错过了信息。如果需要请告知。

最佳答案

在启用了 Gradle Kotlin DSL 的 Android Studio 4.0 canary 4 上,我遇到了同样的错误:

Unable to resolve dependency for ':app@debug/compileClasspath': Cannot convert the provided notation to a File or URI: {dir=libs, include=[*.jar]}.

在我更改构建脚本后

dependencies {
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
}

dependencies {
implementation(fileTree(Pair("dir", "libs"), Pair("include", listOf("*.jar"))))
}

一切正常。 WTF。

关于android - 无法将提供的符号转换为文件或 URI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56576058/

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