android - 使用 Android Studio 启动一个新的 Android 项目
问题描述
我用 Android Studio 启动了一个新的 Android 项目并成为这个错误:
org.gradle.internal.resource.transport.http.HttpRequestException: Could not HEAD 'https://dl.google.com/dl/android/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.pom'.
解决方案
在你的 build.gradle Module:app 上试试这个
configurations.all {
resolutionStrategy {
force 'org.hamcrest:hamcrest-core:1.3'
}}
参考:https ://docs.gradle.org/current/dsl/org.gradle.api.artifacts.ResolutionStrategy.html
让我知道这种方法是否有效。因为如果没有,那就没有更多的方法了。
推荐阅读
- mysql - 使用 Mysql 或 PowerBI 和 3 个表(数据集),您如何将工作日添加到销售日期?
- string - Golang 在字符串中递增数字(使用符文)
- excel - VBA,For Loop,第二个循环的下标超出范围
- php - PHP/SQL:3个表,1个一对一和一对多关系的桥表
- c - 浮点比较
- javascript - formData 为空(通过 XMLHttpRequest 上传时 - 纯 JavaScript)
- javascript - 将自定义域与 Firebase 动态链接结合使用
- sql-server - SQL Server 2008:文件的数据库恢复问题
- sql - 通过 SQL 查询获取随机 N 行,这将与不同部分的总行数成正比
- php - How to convert a mysql json field to a javascript Object with laravel?