osiegmar/FastCSV

Support for devices with API <26 using read methods

nicolaa5 opened this issue · 1 comments

When using the following methods:
read(final File file, final Charset charset) at CsvReader.java:107
read(final Path path, final Charset charset) at CsvReader.java:122

devices < API 26 receive this exception:

java.lang.NoSuchMethodError: No virtual method toPath()Ljava/nio/file/Path; in class Ljava/io/File; or its super classes (declaration of 'java.io.File' appears in /system/framework/core-oj.jar) at de.siegmar.fastcsv.reader.CsvReader.read(CsvReader.java:109)

Most likely because of some methods in the java.nio package are not available for API <26
Call requires API level 26 (current min is 19): java.nio.file.Paths#get

Suggestion would be to add a minimum API requirement for these methods or to read the file in a different way internally if the API is <26

This library does not support Android explicitly – see #3.