justsoft / video_thumbnail

This plugin generates thumbnail from video file or URL. It returns image in memory or writes into a file. It offers rich options to control the image format, resolution and quality. Supports iOS and Android.
MIT License
186 stars 282 forks source link

Deprecated API in use for Java 17, no longer compiles on Java 21 #171

Open YesThatGy opened 1 month ago

YesThatGy commented 1 month ago

Compiling under Java 17, AndroidStudio 2024.1.1 gives these errors but compiles successfully:

Note: /Users/bens/.pub-cache/hosted/pub.dev/video_thumbnail-0.5.3/android/src/main/java/xyz/justsoft/video_thumbnail/VideoThumbnailPlugin.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /Users/bens/.pub-cache/hosted/pub.dev/video_thumbnail-0.5.3/android/src/main/java/xyz/justsoft/video_thumbnail/VideoThumbnailPlugin.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

Attempting to compile under Java 21, AndroidStudio 2024.2.1 (Lady Bug) gives these:

FAILURE: Build failed with an exception.

I see these errors with a fully updated flutter on either machine, and get similar results on either Fedora Core 40 Linux or OSX Sequoia. I have attached the full output compiling under both versions in associated files: compile.java.17.txt compile.java.21.txt

YesThatGy commented 1 month ago

Here's the output trying to run gradlew manually:

as@tesla:~/development/shar2/android$ ./gradlew build

Configure project :app WARNING: The option 'android.enableR8' is deprecated. It was removed in version 7.0 of the Android Gradle plugin. Please remove it from gradle.properties. You are applying Flutter's main Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/to/flutter-gradle-plugin-apply

Task :video_thumbnail:processDebugManifest FAILED Incorrect package="xyz.justsoft.video_thumbnail" found in source AndroidManifest.xml: /home/as/.pub-cache/hosted/pub.dev/video_thumbnail-0.5.3/android/src/main/AndroidManifest.xml. Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported. Recommendation: remove package="xyz.justsoft.video_thumbnail" from the source AndroidManifest.xml: /home/as/.pub-cache/hosted/pub.dev/video_thumbnail-0.5.3/android/src/main/AndroidManifest.xml.

FAILURE: Build failed with an exception.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.9/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 6s 113 actionable tasks: 6 executed, 107 up-to-date as@tesla:~/development/shar2/android$