using video_thumbnail 0.5.3 i go this error Namespace not specified.
while i build my project i got his error 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. iam using flutter sdk :3.24.4
@hosaaam have you found any workaround? I am stuck with this error as well.
For a workaround, you can use this in your android/build.gradle file.
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
afterEvaluate {
// check if `android` block is available and namespace isn't set
if(it.hasProperty('android') && it.android.namespace == null){
def manifest = new XmlSlurper().parse(file(it.android.sourceSets.main.manifest.srcFile))
def packageName = [email protected]()
android.namespace= packageName
}
}
}
facing same issue , will clone and apply fix
i have create pull request and waiting for approval .
meanwhile you can use updated reference to my pacakge code
replace
video_thumbnail: your_version_of_package
with
video_thumbnail: git: url: https://github.com/Shahidbangash/video_thumbnail.git ref: master
i have create pull request and waiting for approval .
meanwhile you can use updated reference to my pacakge code
replace
video_thumbnail: your_version_of_packagewith
video_thumbnail: git: url: https://github.com/Shahidbangash/video_thumbnail.git ref: master
I'm using a package that includes the video_thumbnail package as a dependency. Is there a way for me to override with your working package?
i have create pull request and waiting for approval . meanwhile you can use updated reference to my pacakge code replace
video_thumbnail: your_version_of_packagewithvideo_thumbnail: git: url: https://github.com/Shahidbangash/video_thumbnail.git ref: masterI'm using a package that includes the video_thumbnail package as a dependency. Is there a way for me to override with your working package?
Yes , you can override that package to refer to my package instead of pubspec.yaml version until author fix this issue .
--
you will need to override the package this is referencing to video_thumbnail package
i have create pull request and waiting for approval . meanwhile you can use updated reference to my pacakge code replace
video_thumbnail: your_version_of_packagewithvideo_thumbnail: git: url: https://github.com/Shahidbangash/video_thumbnail.git ref: masterI'm using a package that includes the video_thumbnail package as a dependency. Is there a way for me to override with your working package?
Yes , you can override that package to refer to my package instead of pubspec.yaml version until author fix this issue .
--
you will need to override the package this is referencing to video_thumbnail package
It was fixed in ^8.3.0
https://pub.dev/packages/stream_chat_flutter/changelog
I am facing the same issue. Let me know if there is a solution
Update the root android/build.gradle file as shown below:
buildscript {
// Define global properties for the project
ext {
// The minimum SDK version required for the app to run
minSdkVersion = 24
// The SDK version used to compile the app
compileSdkVersion = 35
// The target SDK version that the app is optimized for
targetSdkVersion = 35
// The Kotlin version used for the project
kotlin_version = '1.9.20'
// Compatible AGP version - The Android Gradle Plugin version used for building the app
build_version = '8.2.0'
}
....
....
.
...
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
project.evaluationDependsOn(':app') // Ensure dependencies are evaluated correctly
plugins.withId('com.android.library') {
extensions.configure(com.android.build.gradle.LibraryExtension) { android ->
// Ensure compileSdkVersion is set
if (!android.hasProperty("compileSdkVersion") || android.compileSdkVersion == null) {
android.compileSdkVersion = rootProject.ext.compileSdkVersion
}
// Retrieve the manifest file path
def manifestFile = android.sourceSets.main.manifest.srcFile
// Attempt to retrieve the package name from AndroidManifest.xml
def packageName = null
if (manifestFile.exists()) {
def manifestContent = new XmlParser().parse(file(manifestFile))
packageName = manifestContent.@package
}
// Ensure namespace is set with fallback logic
if (!android.hasProperty("namespace") || android.namespace == null || android.namespace.isEmpty()) {
if (packageName) {
android.namespace = packageName
} else {
// Set a default namespace if packageName is null
def defaultNamespace = "com.example.${project.name}"
println "Package name is null. Setting default namespace for project: ${project.name} to ${defaultNamespace}"
android.namespace = defaultNamespace
}
}
}
}
}
Since this repo is no longer maintained, better to switch to an active fork like get_thumbnail_video.
It solved the issue for me.