Krishna prasad
Krishna prasad

Reputation: 145

Not able to run the android app in flutter project after android studio update

Recently I updated my android studio to latest version Ladybug | 2024.2.1. After the update I am getting the error like the gradle version is not supported. Later I updated the gradle version to 8.5 and tools build gradle to 8.3.0. Then I am getting some other error I given below

Launching lib/main_dev.dart on sdk gphone64 x86 64 in debug mode...
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. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/to/flutter-gradle-plugin-apply

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: https://flutter.dev/to/flutter-gradle-plugin-apply
2

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':flutter_keyboard_visibility'.
> 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 3s

I am not using the flutter_keyboard_visibility package, I tried to delete manually from the file. Then also getting some other package issue.

Upvotes: 1

Views: 79

Answers (1)

AzPSU
AzPSU

Reputation: 1

Don’t worry! You can fix this issue easily. Let’s go step-by-step:

1- Clean grade because maybe we have stuck depends:

./gradlew clean

2- You can track flutter_keyboard_visibility, if any package is implemented via cmd :

flutter pub deps

3- delete the package flutter_keyboard_visibility manually

4- Remove the pubspec.lock, flutter clean, flutter pub get

Let me know if it works!

Upvotes: 0

Related Questions