【无标题】Unable to find method ‘org.apache.commons.io.filefilter.FileFilterUtils.and()解决思路:换jdk

@[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

这个帖子就是提供一个思路,可能你们的问题不用我这个方法

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值