Samurai016 / Audiotagger

This library allow you to read and write ID3 tags to MP3 files.
https://pub.dev/packages/audiotagger
MIT License
22 stars 20 forks source link

BUG: Cannot read tags in flutter release mode #1

Closed rohansohonee closed 4 years ago

rohansohonee commented 4 years ago
W System.err: java.lang.IllegalArgumentException: NoSuchMethodException: 
Error finding constructor to create copy:
AudioFile audioFile = AudioFileIO.read(file);  // cannot read audio file in release mode

The above exception occurs only in flutter release mode. JAudioTagger library is causing this issue. Can you fix this bug???

rohansohonee commented 4 years ago

ID3Tags.java line 323

throw new IllegalArgumentException("NoSuchMethodException: Error finding constructor to create copy:"+copyObject.getClass().getName());

This exception is only thrown in release mode.

Samurai016 commented 4 years ago

Hi, can you send me your snippet of code? I can't reproduce the error in my code

mlican commented 4 years ago

I have the same problem. The release mode compiled by flutter 1.12.13 can't read the tags.

mrdong916 commented 4 years ago

这个是由于flutter默认开启了混淆代码导致的,只需要在混淆配置proguard-rules.pro文件中排除掉 org.jaudiotagger

-keep class org.jaudiotagger.**  { *; }
rohansohonee commented 4 years ago

@mrdong916 solution works. Closing this issue.

Samurai016 commented 4 years ago

Thank you @mrdong916 , I will update the library as soon as possible. Unfortunately in these days I was full of work and I was not able to search the bug. I really appreciate what you've done.