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

Deprecated imperative apply of Flutter's Gradle plugins #25

Description

@asadamatic

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 {
    ....
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions