无法将提供的表示法转换为文件或 URI



我在运行浓缩咖啡测试时收到以下错误./gradlew connectedAndroidTest

> 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
  }
}
...

不管浓缩咖啡依赖性如何,我都得到了上述错误。有人可以帮忙解决这个问题吗?我是安卓和浓缩咖啡的新手。我不确定我是否错过了信息。如有需要,请告知。

在启用了 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"))))
}

一切正常。跆拳道。

在将 gradle 更新到 3.4.+ 后,我遇到了此错误 降级到 3.3.2 后,我能够毫无问题地构建。

相关内容

  • 没有找到相关文章

最新更新