stream-chat-flutter icon indicating copy to clipboard operation
stream-chat-flutter copied to clipboard

video_thumbnail: Namespace not specified. Specify a namespace in the module's build file.

Open mellow0412 opened this issue 1 year ago • 5 comments

Which packages are you using?

stream_chat_flutter

On what platforms did you experience the issue?

Android

What version are you using?

stream_chat_flutter - 8.1.0

What happened?

I am getting a compile time error describing that the video_thumbnail package needs to specify namespace in its build file.

Steps to reproduce

Using the gradle-8.3-all produces this issue when its compiled for android 
My flutter version is Flutter (Channel stable, 3.24.2)

Supporting info to reproduce

No response

Relevant log output

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.

     If you've specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to https://d.android.com/r/tools/upgrade-assistant/agp-upgrade-assistant for general information about using the AGP Upgrade Assistant.

Flutter analyze output

No response

Flutter doctor output

PS D:\StudioProjects\chat_app> flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.24.2, on Microsoft Windows [Version 10.0.26100.1457], locale en-IN)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[√] Chrome - develop for the web
[X] Visual Studio - develop Windows apps
    X Visual Studio not installed; this is necessary to develop Windows apps.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2024.1)
[√] Connected device (3 available)
[√] Network resources

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

mellow0412 avatar Oct 01 '24 09:10 mellow0412

this solve the problem for me set this 3 lines in settings.gradle plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "com.android.application" version "7.3.0" apply false id "org.jetbrains.kotlin.android" version "2.0.20" apply false } and this line in gradle-wrapper.properties file distributionUrl=https://services.gradle.org/distributions/gradle-7.6.3-all.zip

AliOsmanCSprof avatar Oct 04 '24 20:10 AliOsmanCSprof

@mellow0412 check the above solution

AliOsmanCSprof avatar Oct 04 '24 20:10 AliOsmanCSprof

this solve the problem for me set this 3 lines in settings.gradle plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "com.android.application" version "7.3.0" apply false id "org.jetbrains.kotlin.android" version "2.0.20" apply false } and this line in gradle-wrapper.properties file distributionUrl=https://services.gradle.org/distributions/gradle-7.6.3-all.zip

yes this solution worked for me. Thanks 👍

mellow0412 avatar Oct 07 '24 10:10 mellow0412

hi, so i recently upgraded flutter and android studio now it says gradle version not compatible

┌─ Flutter Fix ───────────────────────────────────────────────────────────────────────────────────┐ │ [!] Your project's Gradle version is incompatible with the Java version that Flutter is using │ │ for Gradle. │ │ │ │ If you recently upgraded Android Studio, consult the migration guide at │ │ https://flutter.dev/to/to/java-gradle-incompatibility. │ │ │ │ Otherwise, to fix this issue, first, check the Java version used by Flutter by running flutter │ │ doctor --verbose. │ │ │ │ Then, update the Gradle version specified in │ │ D:\StudioProjects\chat_app\android\gradle\wrapper\gradle-wrapper.properties to be compatible │ │ with that Java version. See the link below for more information on compatible Java/Gradle │ │ versions: │ │ https://docs.gradle.org/current/userguide/compatibility.html#java │ │ │ │ │ └─────────────────────────────────────────────────────────────────────────────────────────────────┘

mellow0412 avatar Oct 10 '24 07:10 mellow0412

@mellow0412 You can try using Android Studio Giraffe 2022.3.1 Patch 4 to resolve this issue. Gradle 8.3 openjdk 17.0.12 Flutter 3.24.3

Vincent8725 avatar Oct 17 '24 03:10 Vincent8725

Since the video_thumbnail package is no longer actively maintained, could it be replaced with the get_thumbnail_video package or another actively managed alternative?

teqtiv avatar Nov 05 '24 08:11 teqtiv

Since downgrading AGP might not be possible for everyone, another solution could be to use a fork like from this PR

amolgupta avatar Nov 07 '24 23:11 amolgupta