Error building android, any idea?

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not find support-v4.jar (com.android.support:support-v4:27.1.1).
  Searched in the following locations:
      https://jcenter.bintray.com/com/android/support/support-v4/27.1.1/support-v4-27.1.1.jar

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

:app:javaPreCompileDebug FAILED
26 actionable tasks: 1 executed, 25 up-to-date
* Get more help at https://help.gradle.org

BUILD FAILED in 1s
cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not find support-v4.jar (com.android.support:support-v4:27.1.1).
  Searched in the following locations:
      https://jcenter.bintray.com/com/android/support/support-v4/27.1.1/support-v4-27.1.1.jar

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

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

BUILD FAILED in 1s
[ERROR] An error occurred while running subprocess cordova.

        cordova build android exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.

(ionic 4.2)
any idea?

Thanks :slight_smile:

I have the same issue

still got this

Works ! i needed to reinstall the android platform as well

I changed the repositories for build.gradle in platforms\android\app and in platforms\android and it works… Try searching for your repositories

1 Like

this Works for me!, thanks

Works ! i needed to reinstall the android platform as well

Is it possible to change this using build-extras.gradle file instead?