【发布时间】:2020-08-22 17:42:33
【问题描述】:
我希望能够离线处理我的项目。所以我禁用离线模式,按下“使用 gradle 文件同步项目”按钮,然后启用离线模式并尝试构建。但是,每次我这样做时,我都会收到错误:
FAILURE: Build failed with an exception.
*What went wrong:
Could not determine the dependencies of task ':app:compileDebugRenderscript'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
> Could not resolve androidx.fragment:fragment:[1.2.0].
Required by
project :app > androidx.fragment:fragment-ktx:1.2.0
> No cached version listing for androidx.fragment:fragment:[1.2.0] available for offline mode.
> No cached version listing for androidx.fragment:fragment:[1.2.0] available for offline mode.
我还尝试过使缓存/重新启动无效,然后在启用离线模式之前进行 gradle 同步,结果相同。
我正在运行 Android Studio 3.6.3
gradle-wrapper.properties 包含以下内容:
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
如何使 androidx.fragment:fragment 可用于离线模式?
【问题讨论】:
-
希望你已经完成了这里提到的所有解决方案stackoverflow.com/questions/22607661/…
-
完整构建而不是 Gradle Sync 是否正确准备缓存?