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

warning: 6.0.0-beta25 build errors, due to updated dependencies #1870

Closed
2x2xplz opened this issue Nov 12, 2023 · 12 comments
Closed

warning: 6.0.0-beta25 build errors, due to updated dependencies #1870

2x2xplz opened this issue Nov 12, 2023 · 12 comments

Comments

@2x2xplz
Copy link

2x2xplz commented Nov 12, 2023

Not a bug, but a warning. Perhaps re-numbering to 6.1-beta is appropriate.

Upgrading from 6.0.0-beta24+1 to -beta25 updates dependencies, according to the changelog:

Updated androidx.webkit:webkit dependency to 1.8.0
Updated androidx.browser:browser dependency to 1.6.0

The androidx updates require Android 34, which in turn requires Android Gradle Plugin 8+, which is often going to require an upgrade (most existing projects are probably on AGP 7). Additionally, upgrading Gradle plugin from 7 to 8 sometimes introduces a namespace error, here's a SO issue describing the problem.

Typical error when trying to build with 6.0.0-beta25:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
   > 2 issues were found when checking AAR metadata:

       1.  Dependency 'androidx.browser:browser:1.6.0' requires libraries and applications that
           depend on it to compile against version 34 or later of the
           Android APIs.

           :app is currently compiled against android-33.

           Also, the maximum recommended compile SDK version for Android Gradle
           plugin 7.4.2 is 33.

           Recommended action: Update this project's version of the Android Gradle
           plugin to one that supports 34, then update this project to use
           compileSdkVerion of at least 34.

           Note that updating a library or application's compileSdkVersion (which
           allows newer APIs to be used) can be done separately from updating
           targetSdkVersion (which opts the app in to new runtime behavior) and
           minSdkVersion (which determines which devices the app can be installed
           on).

       2.  Dependency 'androidx.webkit:webkit:1.8.0' requires libraries and applications that
           depend on it to compile against version 34 or later of the
           Android APIs.

           :app is currently compiled against android-33.

           Also, the maximum recommended compile SDK version for Android Gradle
           plugin 7.4.2 is 33.

           Recommended action: Update this project's version of the Android Gradle
           plugin to one that supports 34, then update this project to use
           compileSdkVerion of at least 34.

           Note that updating a library or application's compileSdkVersion (which
           allows newer APIs to be used) can be done separately from updating
           targetSdkVersion (which opts the app in to new runtime behavior) and
           minSdkVersion (which determines which devices the app can be installed
           on).

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
Copy link

👋 @2x2xplz

NOTE: This comment is auto-generated.

Are you sure you have already searched for the same problem?

Some people open new issues but they didn't search for something similar or for the same issue. Please, search for it using the GitHub issue search box or on the official inappwebview.dev website, or, also, using Google, StackOverflow, etc. before posting a new one. You may already find an answer to your problem!

If this is really a new issue, then thank you for raising it. I will investigate it and get back to you as soon as possible. Please, make sure you have given me as much context as possible! Also, if you didn't already, post a code example that can replicate this issue.

In the meantime, you can already search for some possible solutions online! Because this plugin uses native WebView, you can search online for the same issue adding android WebView [MY ERROR HERE] or ios WKWebView [MY ERROR HERE] keywords.

Following these steps can save you, me, and other people a lot of time, thanks!

@xzeroplus
Copy link

Same problem. Any update?

@MSmithDev
Copy link

Same here too

@ankit-agrawal-berlin
Copy link

same issue

@SherpaMiguel
Copy link

Same issue

@pichillilorenzo
Copy link
Owner

Perhaps re-numbering to 6.1-beta is appropriate.

The problem with that is that the version 6.0.0 stable has not been already released, otherwise, I would have done it.

The only "fix" is to update your project to support also compileSdkVersion 34 and namespace value inside your android/app/build.gradle file.

You can also check the official Android guide to use Android Studio - Android Gradle plugin Upgrade Assistant

Also, you can check the current Android folder inside the flutter_inappwebview example, for example:

@pichillilorenzo pichillilorenzo pinned this issue Nov 28, 2023
@PawanFyers
Copy link

Even I am facing the same issue

What went wrong:
A problem occurred configuring project ':flutter_inappwebview'.
> 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.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
Exception: Gradle task assembleDebug failed with exit code 1

@pichillilorenzo
Copy link
Owner

@PawanFyers it’s written in the error what you have to do. Check also my previous answer.

@pichillilorenzo
Copy link
Owner

pichillilorenzo commented Nov 30, 2023

By the way it should be ok also using classpath 'com.android.tools.build:gradle:7.3.0' and distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip.

The namespace attribute has been introduced starting from version 7.3.0: https://developer.android.com/build/releases/past-releases/agp-7-3-0-release-notes#package-deprecated.

So, in this case, the requirement is to have compileSdk/compileSdkVersion value to be at least 34.

@tmkook
Copy link

tmkook commented Jan 24, 2024

Has it been fixed? I also encountered it

@pichillilorenzo
Copy link
Owner

@tmkook it won’t fix. You need to upgrade your Android configuration as said in the previous comments.

@Harishwarrior
Copy link

Harishwarrior commented May 15, 2024

@pichillilorenzo

https://github.com/pichillilorenzo/flutter_inappwebview/blob/master/flutter_inappwebview_android/android/build.gradle

This one still uses v33

Error log:

* What went wrong:
Execution failed for task ':flutter_inappwebview_android:checkDebugAndroidTestAarMetadata'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
   > 2 issues were found when checking AAR metadata:
     
       1.  Dependency 'androidx.webkit:webkit:1.8.0' requires libraries and applications that
           depend on it to compile against version 34 or later of the
           Android APIs.
     
           :flutter_inappwebview_android is currently compiled against android-33.
     
           Also, the maximum recommended compile SDK version for Android Gradle
           plugin 7.4.2 is 33.
     
           Recommended action: Update this project's version of the Android Gradle
           plugin to one that supports 34, then update this project to use
           compileSdkVerion of at least 34.
     
           Note that updating a library or application's compileSdkVersion (which
           allows newer APIs to be used) can be done separately from updating
           targetSdkVersion (which opts the app in to new runtime behavior) and
           minSdkVersion (which determines which devices the app can be installed
           on).
     
       2.  Dependency 'androidx.browser:browser:1.6.0' requires libraries and applications that
           depend on it to compile against version 34 or later of the
           Android APIs.
     
           :flutter_inappwebview_android is currently compiled against android-33.
     
           Also, the maximum recommended compile SDK version for Android Gradle
           plugin 7.4.2 is 33.
     
           Recommended action: Update this project's version of the Android Gradle
           plugin to one that supports 34, then update this project to use
           compileSdkVerion of at least 34.
     
           Note that updating a library or application's compileSdkVersion (which
           allows newer APIs to be used) can be done separately from updating
           targetSdkVersion (which opts the app in to new runtime behavior) and
           minSdkVersion (which determines which devices the app can be installed
           on).

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

* Get more help at https://help.gradle.org

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

9 participants