zeus
zeus

Reputation: 13385

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:

Failed resolution of: java/nio/file/Paths;

What can I do?

Upvotes: 4

Views: 2555

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006964

Set your minSdkVersion to 26 or higher, as that class is relatively new.

Alternatively, do not use Paths. Since you have limited access to files on Android Q and higher, you may need to be considering other approaches anyway.

Upvotes: 4

Related Questions