Android Studio 3.4.2 Android 6.0
dependencies {
annotationProcessor "org.androidannotations:androidannotations:$AAVersion"
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'commons-io:commons-io:2.6'
implementation 'edu.vt.middleware:vt-password:3.1.2'
implementation 'org.apache.commons:commons-collections4:4.1'
implementation "org.androidannotations:androidannotations-api:$AAVersion"
До успешной работы кода Android 6.0
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Type;
import java.util.*;
import org.apache.commons.io.FileUtils;
private File myPhotoTempDir;
if (myPhotoTempDir != null && myPhotoTempDir.exists()) {
FileUtils.deleteDirectory(myPhotoTempDir);
}
на Android 6.0 Я получаю ошибку времени выполнения:
FATAL EXCEPTION: main
Process: com.myproject.debug, PID: 7667
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-libart.jar)
at org.apache.commons.io.FileUtils.isSymlink(FileUtils.java:3107)
at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1616)
at com.myproject.profile.EditProfileFragment.goToPrevScreen(EditProfileFragment.java:915)
at com.myproject.profile.EditProfileFragment_.access$201(EditProfileFragment_.java:20)
at com.myproject.profile.EditProfileFragment_$3.run(EditProfileFragment_.java:95)
Что не так с моим кодом?Благодаря.