Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Deprecated imperative apply of Flutter's Gradle plugins #25

Open
asadamatic opened this issue Mar 7, 2024 · 0 comments
Open

Deprecated imperative apply of Flutter's Gradle plugins #25

asadamatic opened this issue Mar 7, 2024 · 0 comments

Comments

@asadamatic
Copy link

Building for Android produces deprecation warnings;

You are applying Flutter's app_plugin_loader Gradle plugin imperatively
using the apply script method, which is deprecated and will be removed in a future release.

You are applying Flutter's main Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block.

I updated my project as recommended here.

Now when I try to build for android, it produces this error

A problem occurred evaluating project ':rich_clipboard_android'.
> Could not get unknown property 'kotlin_version' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

* 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':rich_clipboard_android'.
> Failed to notify project evaluation listener.
   > Could not get unknown property 'android' for project ':rich_clipboard_android' of type org.gradle.api.Project.
   > Could not get unknown property 'android' for project ':rich_clipboard_android' of type org.gradle.api.Project.

Temporary Fix

I have added back, the buildScript defination in android/gradle file.

buildscript {
    ext.kotlin_version = '1.9.10'
    repositories {
    ....
    }

    dependencies {
    ....
    }
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant