【问题标题】:I can't build my first empty project with android studio我无法使用 android studio 构建我的第一个空项目
【发布时间】:2017-11-19 01:10:45
【问题描述】:

最近我安装了 android studio 但我无法构建一个空项目!问题出在哪里?!!
在下面找到同步问题详细信息

Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.support.test:runner:1.0.1.

Could not resolve com.android.support.test:runner:1.0.1.
Required by:
    project :app
 > Could not resolve com.android.support.test:runner:1.0.1.
    > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/support/test/runner/1.0.1/runner-1.0.1.pom'.
          > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/support/test/runner/1.0.1/runner-1.0.1.pom'.
                   > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
                               > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
                                              > unable to find valid certification path to requested target

【问题讨论】:

  • 你能用普通浏览器下载 pom 文件吗?链接:https://dl.google.com/dl/android/maven2/com/android/support/test/runner/1.0.1/runner-1.0.1.pom
  • 不!我不能..出现 404 错误
  • 您的项目似乎没有构建,因为它需要下载该文件。这里可以下载,估计是网络问题。
  • 你可以尝试去掉gradle.build中的测试

标签: android android-studio gradle compilation


【解决方案1】:

你可以尝试把gradle.build(app)里面的依赖里面的所有测试文件去掉,看起来是这样的

testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

问题可能是由于您的互联网连接导致无法下载文件。

【讨论】:

  • 看来问题还不止这个!
  • 无法解析 ':app@debugUnitTest/compileClasspath' 的依赖关系:无法解析 com.android.support:appcompat-v7:26.1.0。
  • 您检查了吗,设置-> 构建、执行、部署-> Gradle 是否处于离线工作状态?如果它打开,也许你可以尝试将其关闭
  • 错误:配置项目 ':app' 时出现问题。 > 无法解析配置“:app:_debugApkCopy”的所有依赖项。 > 无法解析 com.android.support:appcompat-v7:27.+。要求:项目:app > com.android.support:appcompat-v7:27.+ 没有缓存版本列表可用于离线模式。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-10-25
  • 1970-01-01
  • 1970-01-01
  • 2019-07-14
相关资源
最近更新 更多