Android Build Failed
FAILURE: Build failed with an exception.
- What went wrong: A problem occurred configuring project ':webview_cookie_manager'.
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: C:\Users\Name\AppData\Local\Pub\Cache\hosted\pub.dev\webview_cookie_manager-2.0.6\android\build.gradle. 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.
Having the same problem
same
I'm having this issue when attempting to build an APK:
Execution failed for task ':webview_cookie_manager:verifyReleaseResources'. A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action Android resource linking failed ERROR:/home/user123/code/ce/flutter/build/webview_cookie_manager/intermediates/merged_res/release/values/values.xml:194: AAPT: error: resource android:attr/lStar not found.
same
- What went wrong: A problem occurred configuring project ':webview_cookie_manager'.
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.
What went wrong: A problem occurred configuring project ':webview_cookie_manager'.
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.
Is there a solution?
This is already resolved by me in August 2023. My fix in on master via #66 in March 2024. However there is no release with this fix!
In the past I suggested to use my fork, but after some discussions with some other devs, that was a bad idea (since I linked the main branch which I could update in the future).
To use my patch with the official (this) repository you need to change the dependency to this:
webview_cookie_manager:
git:
url: https://github.com/fryette/webview_cookie_manager.git
ref: 4bb434b4a47fe806e95ffc1be28fe4366e5bbd64
The reference is the merge commit of my fix. See #66 to verify it.
I was also facing similar issues what worked for me is manually updating following files:
- IN AndroidManifest:
...\Pub\Cache\hosted\pub.dev\webview_cookie_manager-2.0.6\android\src\main\AndroidManifest.xml
FROM:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.flutter.plugins.webview_cookie_manager">
</manifest>
TO:
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>
- IN BUILD.GRADLE:
"...\Pub\Cache\hosted\pub.dev\webview_cookie_manager-2.0.6\android\build.gradle"
FROM
group 'io.flutter.plugins.webview_cookie_manager'
version '1.0'
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
}
}
rootProject.allprojects {
repositories {
google()
mavenCentral()
maven { url "https://storage.googleapis.com/download.flutter.io" }
}
}
apply plugin: 'com.android.library'
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 16
}
lintOptions {
disable 'InvalidPackage'
}
}
dependencies {
testImplementation 'junit:junit:4.13.1'
}
TO:
group 'io.flutter.plugins.webview_cookie_manager'
version '1.0'
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
}
}
rootProject.allprojects {
repositories {
google()
mavenCentral()
maven { url "https://storage.googleapis.com/download.flutter.io" }
}
}
apply plugin: 'com.android.library'
android {
namespace 'io.flutter.plugins.webviewcookiemanager' // added this line
compileSdkVersion 28
defaultConfig {
minSdkVersion 16
}
lintOptions {
disable 'InvalidPackage'
}
}
dependencies {
testImplementation 'junit:junit:4.13.1'
}
You just pointed out the diff of #66
Why isn't this fix released?
In your pubspec.yaml this would be equivalent to the 2.7.0 release
webview_cookie_manager:
git:
url: https://github.com/fryette/webview_cookie_manager.git
ref: e03954491a6952e04d7fceeae4c4d074392c0fe2
Any update about a version update?