You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an app which has target sdk of 30 and I tried using the package to set the ringtone, it doesn't work. It gives error of "java.lang.IllegalArgumentException: Unsupported MIME type audio/mp3" . I did try setting target sdk to 28 as your file had the same one and it does seem working.
Error I get in detail:
E/MethodChannel#ringtone_set(15044): Failed to handle method call
E/MethodChannel#ringtone_set(15044): java.lang.IllegalArgumentException: Unsupported MIME type audio/mp3
E/MethodChannel#ringtone_set(15044): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:172)
E/MethodChannel#ringtone_set(15044): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142)
E/MethodChannel#ringtone_set(15044): at android.content.ContentProviderProxy.insert(ContentProviderNative.java:549)
E/MethodChannel#ringtone_set(15044): at android.content.ContentResolver.insert(ContentResolver.java:2149)
E/MethodChannel#ringtone_set(15044): at android.content.ContentResolver.insert(ContentResolver.java:2111)
E/MethodChannel#ringtone_set(15044): at acr.rt.ringtone_set.RingtoneSetPlugin.setThings(RingtoneSetPlugin.java:107)
E/MethodChannel#ringtone_set(15044): at acr.rt.ringtone_set.RingtoneSetPlugin.onMethodCall(RingtoneSetPlugin.java:145)
E/MethodChannel#ringtone_set(15044): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/MethodChannel#ringtone_set(15044): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/MethodChannel#ringtone_set(15044): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
E/MethodChannel#ringtone_set(15044): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#ringtone_set(15044): at android.os.MessageQueue.next(MessageQueue.java:335)
E/MethodChannel#ringtone_set(15044): at android.os.Looper.loop(Looper.java:183)
E/MethodChannel#ringtone_set(15044): at android.app.ActivityThread.main(ActivityThread.java:7656)
E/MethodChannel#ringtone_set(15044): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#ringtone_set(15044): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/MethodChannel#ringtone_set(15044): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
The text was updated successfully, but these errors were encountered:
Hey,
I found the solution for the above issue.
Weirdly target api 30 doesn't take MIME type as "audio/mp3". I edited the Java file and changed the MIME type to "audio/mpeg".
It seems to work perfectly.
The changed code is here. I guess you can update it to new verison with this changes so that it can support API 30.
values.put(MediaStore.MediaColumns.MIME_TYPE, "audio/mpeg");
I have an app which has target sdk of 30 and I tried using the package to set the ringtone, it doesn't work. It gives error of "java.lang.IllegalArgumentException: Unsupported MIME type audio/mp3" . I did try setting target sdk to 28 as your file had the same one and it does seem working.
Error I get in detail:
E/MethodChannel#ringtone_set(15044): Failed to handle method call
E/MethodChannel#ringtone_set(15044): java.lang.IllegalArgumentException: Unsupported MIME type audio/mp3
E/MethodChannel#ringtone_set(15044): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:172)
E/MethodChannel#ringtone_set(15044): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142)
E/MethodChannel#ringtone_set(15044): at android.content.ContentProviderProxy.insert(ContentProviderNative.java:549)
E/MethodChannel#ringtone_set(15044): at android.content.ContentResolver.insert(ContentResolver.java:2149)
E/MethodChannel#ringtone_set(15044): at android.content.ContentResolver.insert(ContentResolver.java:2111)
E/MethodChannel#ringtone_set(15044): at acr.rt.ringtone_set.RingtoneSetPlugin.setThings(RingtoneSetPlugin.java:107)
E/MethodChannel#ringtone_set(15044): at acr.rt.ringtone_set.RingtoneSetPlugin.onMethodCall(RingtoneSetPlugin.java:145)
E/MethodChannel#ringtone_set(15044): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/MethodChannel#ringtone_set(15044): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/MethodChannel#ringtone_set(15044): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
E/MethodChannel#ringtone_set(15044): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#ringtone_set(15044): at android.os.MessageQueue.next(MessageQueue.java:335)
E/MethodChannel#ringtone_set(15044): at android.os.Looper.loop(Looper.java:183)
E/MethodChannel#ringtone_set(15044): at android.app.ActivityThread.main(ActivityThread.java:7656)
E/MethodChannel#ringtone_set(15044): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#ringtone_set(15044): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/MethodChannel#ringtone_set(15044): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
The text was updated successfully, but these errors were encountered: