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

Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl. #262

Open
bugrevealingbme opened this issue Mar 29, 2024 · 6 comments

Comments

@bugrevealingbme
Copy link

A problem occurred configuring project ':video_compress'.

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.
@PercyMichael
Copy link

Hey, did you get solution?

@temirfe
Copy link

temirfe commented May 21, 2024

For now it seems that package doesn't work with AGP and Gradle 8, I downgraded agp to 7.4.2 and gradle to 7.5

@shivambunkar68
Copy link

in my case if am using gradle 7.4 error unsupported class file major version 64
else using gradle 8.1.1 error 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.

@shivambunkar68
Copy link

how can solve it

@danialali52
Copy link

what if i dont have [Android Studio], can i fix this problem without Android Studio,, im usnig [Visual Studio Code]

@may-tas
Copy link

may-tas commented Dec 9, 2024

@danialali52 To fix this do this :
it is because the namespace property is not specified, you will have to go to in mac :
/Users/(your_username)/.pub-cache/hosted/pub.dev/video_compress(or whatever package has error)/ android/ build.gradle.

And in the build.gradle file you will see :

  • group ' some package name (this is the namespace) ' .

  • Just copy the group value and go to android block and write :

  • namespace " group value i.e namespace value".

  • Done , Save the file and re-run , it will work now.

  • If you encounter the same problem in any other package, do the same thing.

  • Eg. I have attached a screenshot for a package build.gradle file :

Screenshot 2024-12-09 at 11 54 06 PM

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

6 participants