简体   繁体   English

无法解析以下内容:java / nio / file / Paths;

[英]Failed resolution of: java/nio/file/Paths;

In my code I do this : 在我的代码中,我这样做:

import java.nio.file.Files;
import java.nio.file.Paths;


Files.createDirectories(Paths.get(mMyDir));

But I have this error on some android devices: 但是我在某些android设备上有此错误:

Failed resolution of: java/nio/file/Paths; 无法解析以下内容:java / nio / file / Paths;

How can I do ? 我能怎么做 ?

Set your minSdkVersion to 26 or higher, as that class is relatively new . 将您的minSdkVersion设置为26或更高,因为该类相对较新

Alternatively, do not use Paths . 或者,不要使用Paths Since you have limited access to files on Android Q and higher , you may need to be considering other approaches anyway. 由于您对Android Q及更高版本上的文件的访问权限有限 ,因此您可能仍然需要考虑其他方法。

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

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