alexmercerind / flutter_media_metadata

A Flutter plugin to read 🔖 metadata of 🎵 media files. Supports Windows, Linux, macOS, Android, iOS & Web.
MIT License
69 stars 35 forks source link

Use CompletableFuture from package for lower API level support #21

Closed zhileichen closed 2 years ago

zhileichen commented 2 years ago

According to CompletableFuture CompletableFuture is Added in [API level 24]

If app imported this package build with minSdkVersion less than [API level 24], app would run into this error

Fatal Exception: java.lang.NoClassDefFoundError
Failed resolution of: Ljava/util/concurrent/CompletableFuture;

Caused by java.lang.ClassNotFoundException
Didn't find class "java.util.concurrent.CompletableFuture" 

So this PR is needed to support lower API level, which referred from the flutter official plugin https://github.com/flutter/plugins/commit/0bd38d2a2cf367e2418334bd32d362c1880704be

zhileichen commented 2 years ago

@alexmercerind

alexmercerind commented 2 years ago

According to CompletableFuture CompletableFuture is Added in [API level 24]

If app imported this package build with minSdkVersion less than [API level 24], app would run into this error

Fatal Exception: java.lang.NoClassDefFoundError
Failed resolution of: Ljava/util/concurrent/CompletableFuture;

Caused by java.lang.ClassNotFoundException
Didn't find class "java.util.concurrent.CompletableFuture" 

So this PR is needed to support lower API level, which referred from the flutter official plugin flutter/plugins@0bd38d2

I have merged the PR, I'm not exactly a Java or Android developer. I know more about Windows or Linux plugins.

Thanks for the contribution.