AndroidStudio常见问题
来源:互联网 发布:php导出excel表格乱码 编辑:程序博客网 时间:2024/05/21 06:32
AndroidStudio常见问题:
Error:org.gradle.api.internal.tasks.DefaultTaskInputs$TaskInputUnionFileCollection cannot be cast to org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection
Possible causes for this unexpected error include:- Gradle’s dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network) - The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart) - Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
系统提示有两种解决问题的方式,我的情况下两种方法都是不可行的。后来发现是因为Gradle版本与当前AndroidStudio使用的版本不一致导致的。
- Gradle’s dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Error:The SDK Build Tools revision (24.0.0) is too low for project ‘:app’. Minimum required is 25.0.0
Update Build Tools version and sync project
Open File
Error:The SDK Build Tools revision (24.0.2) is too low for project ‘:photoedit’. Minimum required is 25.0.0
Update Build Tools version and sync project
Open File这两种问题性质是一样的,都有两种解决方法。第一种:修改版本号为25.0.0;第二种:点击 Update Build Tools version and sync project直接更新
- Error:Failed to open zip file.
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文件夹下的gradle-wrapper.properties文件
(2) 修改distributionUrl=https://services.gradle.org/distributions/gradle-3.3-all.zip的版本号(比如3.3),具体修改成什么版本,参照自己其他的项目 - compile、implementation 、 api三者的区别:
(1).之前在使用AndroidStudio引用外部库的时候,我们通常会使用compile fileTree(include: [‘.jar’], dir: ‘libs’),但是在AndroidStudio升级到3.0版本的时候,又新增了两个引用方式implementation fileTree(dir: ‘libs’, include: [‘.jar’])和api fileTree(include: [‘*.jar’], dir: ‘libs’),而compile 则变成了一个过时的方法。
(2).其实implementation 和api是将引用的功能进行细化,比如A、B两个module,B是A的依赖库,B中使用implementation 方法依赖glide库,那么如果在A中使用glide库的话需要重新引用;如果B使用的是api方法引用glide库,那么A可以直接使用glide,
(3).我感觉implementation 相当于类中的private;api相当于类中的public,和compile功能相同。
- AndroidStudio常见问题
- androidstudio常见问题
- AndroidStudio常见问题
- AndroidStudio常见问题
- AndroidStudio常见问题
- AndroidStudio导入项目常见问题
- 配置AndroidStudio常见问题
- AndroidStudio配置常见问题及解决
- AndroidStudio快速入门五:常见问题集合
- AndroidStudio使用常见问题(实时更新)
- AndroidStudio常见问题汇总(一)Rendering Problems
- [整理]Androidstudio项目常见问题集
- 使用AndroidStudio经常遇到的三个常见问题 及解决
- AndroidStudio导入项目时的一些常见问题(偶尔更新)
- AndroidStudio接入信鸽推送常见问题(附安卓接入视频教程)
- androidstudio
- AndroidStudio
- AndroidStudio
- 【逆向】PE文件的基本结构(4) --导入表
- 服务器配置docker
- 添加短信内容模板,腾讯云短信开发案例-短信平台验证码开发4
- 设计模式-Java开发中的23种设计模式详解
- python中的UnicodeEncodeError和UnicodeDecodeError
- AndroidStudio常见问题
- iOS 去除导航栏下面的黑线
- JAVAWEB两种跳转方式的区别及常用的一些场景
- 如何把.npy格式与PIL image相互转换
- Gradle依赖子模块配置
- 【汇编】谈谈volatile变量
- layui参数
- MDK 4.7a自动补齐没了?
- TensorFlow多GPU并行的实现