File.listFiles error for invalid UTF-8 characters

The app crashed while navigating through files inside a directory. crash log as follows:

JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal start byte 0xf6
art/runtime/check_jni.cc:65]     string: 'Test Color.X7  37meaba'

java.io.File.list(File.java:742)
java.io.File.listFiles(File.java:784)

      

+4


source to share


2 answers


Sign the apk before running for this case to avoid crashing.



+5


source


If this happens for files outside (not bundled) of your apk, just test on a real device. For me the emulator was causing the problem.



0


source







All Articles