Flutter plugins crashing on Android Studio Flamingo with Gradle 8.0.0

3k Views Asked by At

Launching lib\main.dart on sdk gphone x86 64 in debug mode... Running Gradle task 'assembleDebug'... Building with Flutter multidex support enabled.

FAILURE: Build failed with an exception.

  • What went wrong: A problem occurred configuring project ':android_alarm_manager_plus'. (Crashing for most plugins from pub.dev'.)

Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl. Namespace not specified. Please specify a namespace in the module's build.gradle file like so:

 android {
     namespace 'com.example.namespace'
 }

 If the package attribute is specified in the source AndroidManifest.xml, it can be migrated automatically to the namespace value in the build.gradle file using the AGP Upgrade Assistant; please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information.
  • 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.


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

This was caused after upgrading & following the AGP upgrade Asistant on Flamingo. Also tried after upgrading the Flamingo Patch.

Added in build.gradle (APP)

applicationId "com.example.app"

Other settings

distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip

classpath 'com.android.tools.build:gradle:8.0.0'

This happened to me after upgrading to Gradle 8.0.0 and Java 17.

2

There are 2 best solutions below

1
On

At present I am downgrading the Android Studio Electic EEL

distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip

classpath 'com.android.tools.build:gradle:7.4.2'

Awaiting suggestions from other community members or until it is solved

2
On

Remove Deprecated plugins or follow the above post if you can't till the plugins are updated.

Example like the ones not being updated by the publishers, then run "AGP upgrade Assistant" to complete the build.

Mine working with this in build.gradle

classpath 'com.android.tools.build:gradle:8.0.2'

& in gradle-wrspper.properties

distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip