Исключение при сохранении атрибутов местоположения в ExifInterface Android - PullRequest
0 голосов
/ 29 октября 2018

Сначала я сохраняю изображение, полученное с камеры, и успешно проверяю его сохранение.

Сначала я сжимаю изображение, затем сохраняю его во внутреннем хранилище и, наконец, я добавляю ExifInterface, который выдает исключения. Попробуйте все доступные решения, но не можете найти решение.

File appFile = new File(path);
if (appFile.exists()) {
    Bitmap bitmap =
        ImageUtils.getInstant()
        .getCompressedBitmap(appFile.getAbsolutePath());
    saveToInternalStorage(bitmap, appFile.getAbsolutePath());
    addExifInfo(appFile.getAbsolutePath());
}
private void addExifInfo(String filePath) {
    try {
        LocationDetector locationDetector = new LocationDetector(BankVerificationActivity.this);
        String latitude = "";
        String longitude = "";
        if (locationDetector.canGetLocation) {
            latitude = locationDetector.getLatitude() + "";
            longitude = locationDetector.getLongitude() + "";
        } else {
            latitude = Utils.getSharedPrefs(context, PrefKeys.Latitude);
            longitude = Utils.getSharedPrefs(context, PrefKeys.Longitude);
        }
        Location location = locationDetector.getLocation();
        ExifInterface exifInterface = new ExifInterface(filePath);
        exifInterface.setAttribute(ExifInterface.TAG_GPS_LATITUDE, GPS.convert(Double.parseDouble(latitude)));
        exifInterface.setAttribute(ExifInterface.TAG_GPS_LONGITUDE, GPS.convert(Double.parseDouble(longitude)));
        exifInterface.setAttribute(ExifInterface.TAG_GPS_LATITUDE_REF, GPS.latitudeRef(Double.parseDouble(latitude)));
        exifInterface.setAttribute(ExifInterface.TAG_GPS_LONGITUDE_REF, GPS.longitudeRef(Double.parseDouble(longitude)));
        exifInterface.saveAttributes();
    }

и ниже Исключение возникает, когда я запускаю над кодом. Изображение успешно сохранено, но файл не найден.

E / System: java.io.FileNotFoundException: файл не существует: /system/framework/org.ifaa.android.manager.jar в java.util.zip.ZipFile. (ZipFile.java:212) в java.util.zip.ZipFile. (ZipFile.java:149) в java.util.jar.JarFile. (JarFile.java:160) в java.util.jar.JarFile. (JarFile.java:97) at libcore.io.ClassPathURLStreamHandler.

Пожалуйста, помогите мне решить эту проблему. Я не могу найти решение.

...