我一直在尝试运行android studio的默认项目(使用Kotlin),但它不工作,它给了我21个错误,但它们似乎都源于“androidx.compose.material:material:1.4.0”或“androidx.concurrent:concurrent-futures:1.1.0”
我不得不说,我不知道我在做什么,我昨天刚刚开始摆弄android studio。如果我点击链接(例如https://dl.google.com/dl/android/maven2/androidx/compose/material/material/1.4.0/material-1.4.0.aar),那么该文件将在浏览器中下载,但我不知道该如何处理它。
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Failed to transform material-1.4.0.aar (androidx.compose.material:material:1.4.0) to match attributes {artifactType=android-aar-metadata, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Could not find material-1.4.0.aar (androidx.compose.material:material:1.4.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/compose/material/material/1.4.0/material-1.4.0.aar
7: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Failed to transform material-1.4.0.aar (androidx.compose.material:material:1.4.0) to match attributes {artifactType=android-jni, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Could not find material-1.4.0.aar (androidx.compose.material:material:1.4.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/compose/material/material/1.4.0/material-1.4.0.aar
> Failed to transform concurrent-futures-1.1.0.jar (androidx.concurrent:concurrent-futures:1.1.0) to match attributes {artifactType=android-jni, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.jvm.version=7, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Could not find concurrent-futures-1.1.0.jar (androidx.concurrent:concurrent-futures:1.1.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/concurrent/concurrent-futures/1.1.0/concurrent-futures-1.1.0.jar
- 我试着重新安装整个程序,无济于事。- 将Gradle JDK从jbr-17更改为Oracle Open JDK 21,没有发生任何变化。- 我将Kotlin编译器更改为最新版本-我使用了“无效缓存”,这也没有解决问题-我将Android SDK目标和编译SDK更改为34,这也没有改变任何东西-我试图将“JAVA_HOME”从“C:\Program Files\Android\Android Studio\jbr”更改为“C:/Users/mgi 30/.jdks/openjdk-21”,这会导致不同的错误,所以我在事后撤销了更改
1条答案
按热度按时间tpxzln5u1#
我找到解决办法了
如果您删除C:\Users\erName中的.gradel文件夹,则下次尝试运行该程序时,它将重新下载所需数据,然后它工作正常