Body
Description
I’m encountering a build failure in my Flutter project when using the video_thumbnail plugin (version 0.5.0) with Android Gradle Plugin (AGP) 8.0 or higher. The error occurs because the plugin’s android/build.gradle file does not specify a namespace, which is now mandatory for Android libraries in AGP 8.0+.
Error Message
text
Collapse
Wrap
Copy
FAILURE: Build failed with an exception.
- What went wrong:
A problem occurred configuring project ':video_thumbnail'.
Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.
Namespace not specified. Specify a namespace in the module's build file. See https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace.
Steps to Reproduce
Create a Flutter project with video_thumbnail: ^0.5.0 in pubspec.yaml.
Update the project’s AGP to 8.1.0 in android/build.gradle:
text
Collapse
Wrap
Copy
classpath 'com.android.tools.build:gradle:8.1.0'
Set Gradle to version 8.0 in android/gradle/wrapper/gradle-wrapper.properties:
text
Collapse
Wrap
Copy
distributionUrl=https://services.gradle.org/distributions/gradle-8.0-bin.zip
Run flutter build apk --release.
Build fails with the above error.
Expected Behavior
The plugin should build successfully with AGP 8.0+ without requiring manual modifications.
Actual Behavior
The build fails due to the missing namespace in the plugin’s android/build.gradle.
Suggested Fix
Add a namespace to the android block in the plugin’s build.gradle, matching the package attribute from AndroidManifest.xml (e.g., com.cheekybits.videothumbnail). For example:
groovy
Collapse
Wrap
Copy
android {
namespace 'com.cheekybits.videothumbnail'
compileSdkVersion 33
defaultConfig {
minSdkVersion 16
}
}
Workaround
As a temporary fix, I copied the plugin locally, added the namespace, and updated my pubspec.yaml to use the local path:
yaml
Collapse
Wrap
Copy
video_thumbnail:
path: ../local_plugins/video_thumbnail
However, this isn’t ideal for long-term use or distribution.
Environment
Flutter: [e.g., 3.19.0] (please specify your version)
video_thumbnail: 0.5.0
AGP: 8.1.0
Gradle: 8.0
OS: [e.g., macOS 14.0] (please specify your OS)
Additional Notes
Updating to the latest version (e.g., 0.5.3) might resolve this if the fix is already included—could you confirm if this has been addressed in newer releases?
If the plugin is no longer maintained, it might be worth noting this in the README or suggesting alternatives like thumbnailer or video_compress.
Request
Could you please update the plugin to include the namespace in build.gradle to ensure compatibility with AGP 8.0+? Alternatively, if this is already fixed in a newer version, please let me know which version to use. I’d be happy to test a fix or submit a PR if needed.
Thanks for maintaining this plugin!
Body
Description
I’m encountering a build failure in my Flutter project when using the video_thumbnail plugin (version 0.5.0) with Android Gradle Plugin (AGP) 8.0 or higher. The error occurs because the plugin’s android/build.gradle file does not specify a namespace, which is now mandatory for Android libraries in AGP 8.0+.
Error Message
text
Collapse
Wrap
Copy
FAILURE: Build failed with an exception.
A problem occurred configuring project ':video_thumbnail'.
Collapse
Wrap
Copy
classpath 'com.android.tools.build:gradle:8.1.0'
Set Gradle to version 8.0 in android/gradle/wrapper/gradle-wrapper.properties:
text
Collapse
Wrap
Copy
distributionUrl=https://services.gradle.org/distributions/gradle-8.0-bin.zip
Run flutter build apk --release.
Build fails with the above error.
Expected Behavior
The plugin should build successfully with AGP 8.0+ without requiring manual modifications.
Actual Behavior
The build fails due to the missing namespace in the plugin’s android/build.gradle.
Suggested Fix
Add a namespace to the android block in the plugin’s build.gradle, matching the package attribute from AndroidManifest.xml (e.g., com.cheekybits.videothumbnail). For example:
groovy
Collapse
Wrap
Copy
android {
namespace 'com.cheekybits.videothumbnail'
compileSdkVersion 33
defaultConfig {
minSdkVersion 16
}
}
Workaround
As a temporary fix, I copied the plugin locally, added the namespace, and updated my pubspec.yaml to use the local path:
yaml
Collapse
Wrap
Copy
video_thumbnail:
path: ../local_plugins/video_thumbnail
However, this isn’t ideal for long-term use or distribution.
Environment
Flutter: [e.g., 3.19.0] (please specify your version)
video_thumbnail: 0.5.0
AGP: 8.1.0
Gradle: 8.0
OS: [e.g., macOS 14.0] (please specify your OS)
Additional Notes
Updating to the latest version (e.g., 0.5.3) might resolve this if the fix is already included—could you confirm if this has been addressed in newer releases?
If the plugin is no longer maintained, it might be worth noting this in the README or suggesting alternatives like thumbnailer or video_compress.
Request
Could you please update the plugin to include the namespace in build.gradle to ensure compatibility with AGP 8.0+? Alternatively, if this is already fixed in a newer version, please let me know which version to use. I’d be happy to test a fix or submit a PR if needed.
Thanks for maintaining this plugin!