I'm having trouble launching the app in the Android emulator

Sorry if I ask a stupid question, but I’ve been trying for a while now and can’t figure it out. I have used so many solutions and it just doesn’t work, The app itself has no bugs and is just fine and the error message:

‘‘Build file ‘C:\Users\User\StudioProjects\workbridges\android\build.gradle’ line: 28’’

is also without bugs in the file and it doesn’t cause a problem… This is what I get when I want to open the app with Android emulator:

''Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\Gebruiker\StudioProjects\workbridges\android\build.gradle' line: 28

* What went wrong:
A problem occurred evaluating root project 'android'.
> Build completed with 1 failures.
   > com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: com/android/build/api/extension/AndroidComponentsExtension

* 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 920ms
Exception: Gradle task assembleDebug failed with exit code 1''

I would really appreciate it if someone could help me.

This sounds less like a Gradle question, but more like an Android question.
I recommend you ask in some Android community.
You might have better chances for help with this there.

I came here to ask for help because the error code says, ‘’> Get more help at https://help.gradle.org.‘’ I will also look at an Android community, thanks for your answer anyway.

Yes, unfortunately every failed Gradle execution gives that non-sense advice, even if you for example have a compilation error because you wrote invalid syntax in your programming language.

So the help you get from me is a redirect to a better place for the question. :slight_smile:
You can of course also wait for someone else having a better answer that solves your problem.
I just recommended to ask at a place where the probability for getting help is higher. :slight_smile:

1 Like

Yes, thanks for your advice!

1 Like

I finally solved it after 24 days. And you’ll never guess how… via gradle.org.

1 Like

Mind sharing how you solved it?
Someone else may have the same problem in the future and stumble over this thread then.

El conquistador, puede por favor compartir como ha solucionado el problema? tengo el mismo problema desde hace tiempo, lo he probado todo

@The_Conqueror como lo solucionaste?, tengo el mismo problema y ya creo haberlo intentado todo

Would you mind sticking to English please?
I doubt many people on this forum are savvy in Spanish.