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

Android Build Failed #75

Open
Hadjimamas opened this issue Nov 16, 2024 · 8 comments
Open

Android Build Failed #75

Hadjimamas opened this issue Nov 16, 2024 · 8 comments

Comments

@Hadjimamas
Copy link

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

Having the same problem

@etroyan
Copy link

etroyan commented Nov 21, 2024

same

@doughywilson
Copy link

doughywilson commented Nov 22, 2024

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.

@DaenPve
Copy link

DaenPve commented Dec 1, 2024

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.

@mooosamir
Copy link

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?

@rekire
Copy link
Contributor

rekire commented Jan 12, 2025

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.

@Hmmza-tariq
Copy link

I was also facing similar issues what worked for me is manually updating following files:

  1. 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>
  1. 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'
}

@rekire
Copy link
Contributor

rekire commented Feb 1, 2025

You just pointed out the diff of #66

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

8 participants