1

I'm trying to edit tags of audio files and for that I'm using JaudioTagger. But a problem exists and I can't figure it out.

I'm getting this error:

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)

And my code for getting tags of audio files :

            File path = new File(songInfoModel.getData());
            Log.e("Path: ", path.toString());
            try {
                AudioFile f = AudioFileIO.read(path);
                Tag tag = f.getTag();
                String artist = tag.getFirst(FieldKey.ARTIST);
                tag.getFirst(FieldKey.ALBUM);
                tag.getFirst(FieldKey.TITLE);
                tag.getFirst(FieldKey.COMMENT);
                tag.getFirst(FieldKey.YEAR);
                tag.getFirst(FieldKey.TRACK);
                tag.getFirst(FieldKey.DISC_NO);
                tag.getFirst(FieldKey.COMPOSER);
                tag.getFirst(FieldKey.ARTIST_SORT);

                Log.e("Artist: ",artist);
            } catch (CannotReadException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            } catch (TagException e) {
                e.printStackTrace();
            } catch (ReadOnlyFileException e) {
                e.printStackTrace();
            } catch (InvalidAudioFrameException e) {
                e.printStackTrace();
            }
Paul Taylor
  • 13,411
  • 42
  • 184
  • 351
Rektirino
  • 582
  • 5
  • 24
  • this is a known problem with jaudiotagger. Check out this thread for more details. The latest version of android api27 now has the necessary files. https://bitbucket.org/ijabz/jaudiotagger/issues/149/some-nio-classes-are-unavailable-while – Theo Jan 12 '18 at 17:03
  • Actually I resolved it by downgrading to the previous version. Now it works fine. Thank you – Rektirino Jan 13 '18 at 17:39
  • Can you please post the version you now use? – Theo Jan 14 '18 at 14:37
  • Yeah sure, I use 2.2.3. – Rektirino Jan 14 '18 at 14:38
  • Theo, I have a question actually, wonder if you could help me with it? It's related to expandable recyclerview. – Rektirino Jan 14 '18 at 14:39
  • I will try. Contact me by email though. email address can be found on http://www.theo.klinkweb.nl/ – Theo Jan 14 '18 at 15:21
  • okay. Actually I have posted the question. https://stackoverflow.com/questions/48250204/how-to-create-multiple-views-in-parent-viewholderexpandable-recyclerview – Rektirino Jan 14 '18 at 15:23

0 Answers0