Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Namespace not specified using gradle 8.4.0 #343

Open
latiefdole opened this issue Mar 7, 2024 · 4 comments
Open

Namespace not specified using gradle 8.4.0 #343

latiefdole opened this issue Mar 7, 2024 · 4 comments

Comments

@latiefdole
Copy link

I'm encountering an issue while trying to configure the Flutter Barcode Scanner project. When I try to build the project, I receive the following error message:

A problem occurred configuring project ':flutter_barcode_scanner'.

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.
I have checked the module's build file, but I'm unsure how to correctly specify the namespace. I have also reviewed the Android documentation provided in the error message, but I'm still having trouble resolving the issue.

Could someone please provide guidance on how to properly set the namespace in the build file? Any help or suggestions would be greatly appreciated.

Thank you in advance for your assistance!

@devNamanG
Copy link

I guess since the plugin has not been updated since more than 2 years on pub.dev, it is better to switch to a different plugin like mobile_scanner.

@LuisGutierrezArone
Copy link

hola a todos, pude encontrar la solución a ello se que es demasiado tarde esta implementación la he usado en muchas dependencia que aun no es compatible con gradle 8.4.0, yo lo corregí en mi local aunque no es la manera correcta pero con ello solucioné el inconveniente de versión.

Primero debes ir al archivo glader del flutter_barcode_scanner te dejo el código que edité

rootProject.allprojects {
repositories {
google()
//jcenter()
mavenCentral()
}
}

apply plugin: 'com.android.library'

android {
if (project.android.hasProperty("namespace")) {
namespace 'com.amolg.flutterbarcodescanner'
}

compileSdkVersion 30

defaultConfig {
    minSdkVersion 16
    targetSdkVersion 30
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
lintOptions {
    disable 'InvalidPackage'
}

}

dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'com.google.android.gms:play-services-vision:20.1.3'
}

@latiefdole
Copy link
Author

I guess since the plugin has not been updated since more than 2 years on pub.dev, it is better to switch to a different plugin like mobile_scanner.

Ok, thanks for reference

@devNamanG
Copy link

@latiefdole Welcome! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants