Build failed with an exception in android studio

44 Views Asked by At

FAILURE: Build failed with an exception.

  • Where: Build file 'C:\Users\richard\StudioProjects\bb\android\app\build.gradle' line: 2

  • What went wrong: Plugin [id: 'com.android.application'] was not found in any of the following sources:

  • Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
  • Plugin Repositories (plugin dependency must include a version number for this source)
  • 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 5s Exception: Gradle task assembleDebug failed with exit code 1

1

There are 1 best solutions below

1
Jaxon M On

Add the following line at the top of your build.gradle file:

apply plugin: 'com.android.application'

And then sync gradle.