@[TOC](Unable to find method ‘org.apache.commons.io.filefilter.FileFilterUtils.and([Lorg/apache/commons/io/filefilter/IOFileFilter;)Lorg/apache/commons/io/filefilter/IOFileFilter;’)
这个帖子就是提供一个思路:换jdk
版本:Android Studio Dolphin | 2021.3.1 Canary 8
我遇到的问题是每次打开Android项目都会遇到一个错误
应该是在gradle build的过程中出现的
Unable to find method 'org.apache.commons.io.filefilter.FileFilterUtils.and([Lorg/apache/commons/io/filefilter/IOFileFilter;)Lorg/apache/commons/io/filefilter/IOFileFilter;'
org.apache.commons.io.filefilter.FileFilterUtils.and([Lorg/apache/commons/io/filefilter/IOFileFilter;)Lorg/apache/commons/io/filefilter/IOFileFilter;
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.
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
尝试过在build.gradle文件里做一些修改
比如换成国内镜像,然而并没有什么用
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
// google()
// jcenter()
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' } //gradle 国内镜像仓
maven { url 'https://maven.aliyun.com/repository/google' } //google 国内镜像仓
maven { url 'https://maven.aliyun.com/repository/jcenter' } //jcenter 国内镜像仓
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
// google()
// jcenter()
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' } //gradle 国内镜像仓
maven { url 'https://maven.aliyun.com/repository/google' } //google 国内镜像仓
maven { url 'https://maven.aliyun.com/repository/jcenter' } //jcenter 国内镜像仓
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
后来突然想起来之前成功运行的Android项目,AS提示我换过jdk
然后就根据图片顺序打开对应的界面
发现这个Gradle JDK使用的是我自己安装的jdk8
之前成功运行的Android项目的Gradle JDK用的则是Android Studio自带的jre
然后我就换了一下jdk
我的路径是选择的路径是
D:\tools\DeveloperTool\Android\Android Studio\jre
你们要选的路径就是Android Studio安装路径\jre
这个帖子就是提供一个思路,可能你们的问题不用我这个方法