【发布时间】:2023-03-25 11:20:01
【问题描述】:
我阅读了Sweet AlertDialog 教程,并通过这种方式将依赖项添加到我的项目中:
选择 Build.Gradle (Module:app) 并打开
-
转到这一行:
dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) }并更改为:
dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'cn.pedant.sweetalert:library:1.3' } -
运行我的应用程序。但我收到此错误:
Error:A problem occurred configuring project ':app'. > Could not resolve all dependencies for configuration ':app:_debugCompile'. > Could not find com.android.support:appcompat-v7:21.0.0. Searched in the following locations: https://jcenter.bintray.com/com/android/support/appcompat-v7/21.0.0/appcompat-v7-21.0.0.pom https://jcenter.bintray.com/com/android/support/appcompat-v7/21.0.0/appcompat-v7-21.0.0.jar file:/D:/sdk/ADT-Bundle-Windows-x86-20140702.Full_p30download.com/sdk/extras/android/m2repository/com/android/support/appcompat-v7/21.0.0/appcompat-v7-21.0.0.pom file:/D:/sdk/ADT-Bundle-Windows-x86-20140702.Full_p30download.com/sdk/extras/android/m2repository/com/android/support/appcompat-v7/21.0.0/appcompat-v7-21.0.0.jar file:/D:/sdk/ADT-Bundle-Windows-x86-20140702.Full_p30download.com/sdk/extras/google/m2repository/com/android/support/appcompat-v7/21.0.0/appcompat-v7-21.0.0.pom file:/D:/sdk/ADT-Bundle-Windows-x86-20140702.Full_p30download.com/sdk/extras/google/m2repository/com/android/support/appcompat-v7/21.0.0/appcompat-v7-21.0.0.jar Required by: MyApplication:app:unspecified > cn.pedant.sweetalert:library:1.3 > com.pnikosis:materialish-progress:1.0
当我添加 appcompat-v7-21.0.0.jar 时,我收到此错误:
Error:Failed to find: com.android.support:appcompat-v7:21.0.0
<a href="openFile">Open File</a><br><a href="open.dependency.in.project.structure">Open in Project Structure dialog</a>
【问题讨论】:
-
我遇到了同样的错误。我不知道如何解决。为什么安卓这么复杂。 ://