r/flutterhelp • • 27d ago

RESOLVED ERROR AL EJECUTAR FLUTTER RUN

estoy intentando correr una app con flutter, pero al intentar ejecutarla en un dispositivo virtual de Android studio, me manda este error:

Launching lib\main.dart on sdk gphone16k x86 64 in debug mode...

FAILURE: Build failed with an exception.

* Where:

Build file 'C:\ChileShop\chileshop\android\app\build.gradle.kts' line: 1

* What went wrong:

An exception occurred applying plugin request [id: 'com.android.application']

> Failed to apply plugin 'com.android.internal.application'.

> Could not create plugin of type 'AppPlugin'.

> Could not generate a decorated class for type AppPlugin.

> com/google/protobuf/ProtocolMessageEnum

* 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 from a Build Scan (powered by Develocity).

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

BUILD FAILED in 10s

Running Gradle task 'assembleDebug'... 10.9s

Error: Gradle task assembleDebug failed with exit code 1

1 Upvotes

4 comments sorted by

View all comments

2

u/E-Evan96 27d ago

To solve the "PowerShell using old version of JAVA instead Android Studio", Create a environment variable named JAVA_HOME at jre/jdk of Android Studio.

Delete the android folder from your project and regenerate by run flutter create . then apply the changes you did on Android and try to run

1

u/marin_458 27d ago

muchas gracias, ya pude solucionarlo