Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/194.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android甜警报对话框依赖项_Android_Github_Gradle - Fatal编程技术网

Android甜警报对话框依赖项

Android甜警报对话框依赖项,android,github,gradle,Android,Github,Gradle,我阅读了教程,并通过以下方式向我的项目添加了依赖项: 选择Build.Gradle(模块:app)并打开 转到这一行: dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) } 并改为: dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'cn.pedant.sweetalert:library:1.

我阅读了教程,并通过以下方式向我的项目添加了依赖项:

  • 选择Build.Gradle(模块: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
    
    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>
    
  • 当我添加
    appcompat-v7-21.0.0.jar
    时,我得到以下错误:

    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
    
    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>
    
    错误:未能找到:com.android.support:appcompat-v7:21.0.0
    

    首先删除appcompat-v7-21.0.0.jar,然后尝试用以下内容替换依赖项:

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.android.support:appcompat-v7:21.0.3'
        compile 'cn.pedant.sweetalert:library:1.3'
    }
    

    如果是缺少支持库的情况,我认为您需要从


    Android SDK管理器->SDK工具->支持存储库->Android支持存储库。

    编写代码后,我发现以下错误:错误:配置项目时出现问题:应用程序''>无法解析配置“”的所有依赖项:应用:_debugCompile'>无法解析com.android。支持:appcompat-v7:21.0.3。>repo.jfrog.org>无法解析com.android.support:appcompat-v7:21.0.3。需要者:MyApplication:app:unspecified>cn.pedant.sweetalert:library:1.3>com.pnikosis:materialish progress:1.0>无法获取“”。>repo.jfrog.orgI也犯了同样的错误。我不知道如何修理。为什么Android如此复杂:/