简体   繁体   English

Android Studio项目中的库的导入类已锁定

[英]import class of libs in the Android Studio project is locked

I copied the commons-io-2.6.jr into libs folder, and I've decompressed it. 我将commons-io-2.6.jr复制到libs文件夹中,并对其进行了解压缩。 But the icon shows classes were locked. 但是该图标显示课程已被锁定。 The FileUtils class can not be used. 不能使用FileUtils类。 在此处输入图片说明

在此处输入图片说明

在此处输入图片说明

You don't need to decompress the jar file to use it. 您无需解压缩jar文件即可使用它。 Instead of using the jar, you can import the commons-io library through Gradle. 您可以通过Gradle导入commons-io库,而不必使用jar。 Add this line in your app's build.gradle file: 在您的应用程序的build.gradle文件中添加以下行:

dependencies {
    implementation 'commons-io:commons-io:2.6'
    // other libs...
}

If you really want to use the jar file, you can import your libs folder through Gradle as explained here . 如果您确实要使用jar文件,则可以按照此处的说明通过Gradle导入libs文件夹。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM