You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android依赖解析失败求助:releaseUnitTest编译路径依赖无法解决

Fixing "Unable to resolve dependency" for AndroidSwipeableCardStack

Hey there, let's work through this dependency resolution error you're hitting. The error Error:Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve com.github.wenchaojiang:AndroidSwipeableCardStack:0. . . usually points to a few common issues—here's how to fix them:

  • Check the dependency version number
    The version in your error is cut off (0. . .) which means you probably didn't specify a valid, complete version for the library. Find the latest stable version from the library's GitHub page, then update your dependency line to use it. For example, if the latest version is 1.0.0, your line should look like this:

    implementation 'com.github.wenchaojiang:AndroidSwipeableCardStack:1.0.0'
    
  • Add JitPack repository to your project
    GitHub-hosted libraries like this one are often served via JitPack, which isn't included in Gradle's default repositories. Open your project-level build.gradle file and add the JitPack repo to the repositories block under allprojects:

    allprojects {
        repositories {
            google()
            mavenCentral()
            maven { url 'https://jitpack.io' } // Add this line
        }
    }
    

    If you're using Gradle 7.0+, you'll need to add this to the settings.gradle file instead, under the dependencyResolutionManagement block.

  • Ensure releaseUnitTest variant has repository access
    Sometimes build variants can have restricted repository configurations. Double-check that your releaseUnitTest variant isn't blocked from accessing JitPack. Most of the time, adding the repo at the project level covers all variants, but if you have module-specific repo settings, make sure JitPack is included there too.

  • Refresh dependencies and clean the build
    Local Gradle cache can hold stale or broken references. Run these commands in your terminal to clear the cache and force a fresh download:

    ./gradlew clean
    ./gradlew build --refresh-dependencies
    

    On Windows, use gradlew.bat instead of ./gradlew.

  • Verify network connectivity
    If none of the above works, check if your network is blocking access to JitPack. Firewalls, proxies, or VPNs might prevent Gradle from downloading the dependency. Try visiting https://jitpack.io in a browser to confirm it's reachable.

内容的提问来源于stack exchange,提问作者ganesh

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 03:18:22