总结项目编译遇到的几个问题

  • 希望自己的一些解决问题的经历可以分享给需要的各位
    • 问题1:Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
      • 问题描述
      • 解决方案
      • 原因
    • 问题二:Connect to dl.google.com:443 no response
      • 问题描述
      • 解决方案
      • 原因
    • 问题三:WARNING: The following project options are deprecated and have been removed:
      • 问题描述
      • 解决方案
      • 原因
    • 问题四:You have JVM property "socksProxyHost" set to "127.0.0.1".
      • 问题描述
      • 解决方案
      • 原因
    • 问题五:Could not find builder.jar (com.android.tools.build:builder:3.1.0). Searched in the following locations:
      • 问题描述
      • 解决方案
      • 原因

希望自己的一些解决问题的经历可以分享给需要的各位

在运行项目的过程中,或多或少都会遇到一些编译的问题,项目跑不起来的感觉真的让人真着急,相信每一个程序员都感同身受,折腾了一天半,解决了自己项目的编译问题,迫不及待的分享给需要的那个你。

问题1:Gradle’s dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)

问题描述

Gradle’s dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
Re-download dependencies and sync project (requires network)

解决方案

1.打开项目中的 gradle-wrapper.properties 文件
2.将会看到这样一行指定下载gradle的地址:distributionUrl=https://services.gradle.org/distributions/gradle-4.6-all.zip
3.将https改成http 或者 将all改成bin

原因

待续

问题二:Connect to dl.google.com:443 no response

问题描述

Connect to dl.google.com:443 no response

解决方案

在xxx\android-studio\gradle\m2repository\com\android\tools\build\gradle找到已经下载好的版本替换一下

原因

待续

问题三:WARNING: The following project options are deprecated and have been removed:

问题描述

ERROR: Unable to resolve dependency for ‘:[email protected]/compileClasspath’: Could not resolve com.android.support:appcompat-v7:28.0.0.
Show Details
Affected Modules: app
WARNING: The following project options are deprecated and have been removed:
android.enableAapt2
This property has no effect, AAPT2 is now always used.

解决方案

移除gradle.properties中android.enableAapt2=true

原因

28.0.0已经不支持AAPT2,移除相关配置即可

问题四:You have JVM property “socksProxyHost” set to “127.0.0.1”.

问题描述

This may lead to incorrect behaviour. Proxy should be set in Settings | HTTP proxy.
    This JVM property is old and its usage is not recommended by Oracle.
    (Note: It could have been assigned by some code dynamically.)

解决方案

重启电脑

原因

我猜测可能是因为端口冲突

问题五:Could not find builder.jar (com.android.tools.build:builder:3.1.0). Searched in the following locations:

问题描述

Could not find builder.jar (com.android.tools.build:builder:3.1.0). Searched in the following locations: https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/3.1.0/builder-3.1.0.jar
其实也不针对3.1.0,任何一个版本的jar都可能出现这个问题

解决方案

原因

我猜测是代理不支持https的下载

更多相关文章

  1. 解决'keytool' is not recognized as an internal or external c
  2. Android(安卓)NDK 使用memcpy memset 等函数报错 解决办法
  3. 打成系统包时遇到的异常
  4. Android(安卓)Intent和PendingIntent的区别详细说明
  5. Android常用库
  6. Android聊天背景图片变形解决方案
  7. Android二进制工具objdump/readelf不能打印出function@plt的解决
  8. Android(安卓)Log 配置解决方案
  9. 【翻译】4种经典的Android屏幕自适应解决方案

随机推荐

  1. Ubuntu 13.04 编译环境配置及android 2.3
  2. Android中使用Gallery_tabhost来实现标签
  3. alps/frameworks/base/wifi/java/android
  4. Android(安卓)APK 打包
  5. 与spinner有关的样式
  6. android短信和彩信探秘threads
  7. android音乐播放器常见操作
  8. android 获取 imei号码以及其他信息
  9. android 状态栏移动到底部
  10. Android三种方法设置ImageView的图片