Sitemap

A problem occurred configuring project ‘:overlay_webview’.

1 min readJun 7, 2025

--

The exact issue:
A problem occurred configuring project ‘:overlay_webview’. > Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.

Some solutions that I found were to add the following code in the android/build.gradle:

// This should be already in your file
allprojects {
repositories {
google()
mavenCentral()
}
// Add this part -------------->
subprojects {
afterEvaluate { project ->
if (project.hasProperty('android')) {
project.android {
if (namespace == null) {
namespace project.group
}
}
}
}
}
// until here}

But this only gave me another error:
Cannot run Project.afterEvaluate(Closure) when the project is already evaluated

Get Dexter’s stories in your inbox

Join Medium for free to get updates from this writer.

Eventually, what solved the problem for me was to run :

flutter clean 
flutter pub cache repair
flutter pub get

Now since I was using a forked repo, it maybe a problem specifically for that, so I had to comment that dependency and run:
flutter pub get, then uncomment it and run pub get again.

I am sure this solution will work only for very specific cases but worked as a last resort :)

--

--