0

I have a problem in Android Studio when trying to run the project, I get this error

FAILURE: Build failed with an exception.

What went wrong: A problem occurred configuring root project 'android'.

Could not resolve all artifacts for configuration ':classpath'. Could not download builder.jar (com.android.tools.build:builder:3.5.0) Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/3.5.0/builder-3.5.0.jar'. Premature end of Content-Length delimited message body (expected: 8174407; received: 4456416 Could not download bundletool.jar (com.android.tools.build:bundletool:0.9.0) Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/bundletool/0.9.0/bundletool-0.9.0.jar'. Premature end of Content-Length delimited message body (expected: 5248142; received: 4456416

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 19m 23s Finished with error: Gradle task assembleDebug failed with exit code 1

halfer
  • 19,824
  • 17
  • 99
  • 186
Grb
  • 1
  • The error sounds like a temporary networking problem. Could you try again? – halfer Apr 18 '20 at 10:58
  • I have tried it atleast 5 times. trying it for last 5 days but still showing same error – Grb Apr 18 '20 at 11:01
  • OK. I am not familiar with Android development, but I doubt there is enough information here for readers to help you. Could you edit your question to include the file that specifies your project dependencies? – halfer Apr 18 '20 at 11:02
  • [Possible similar problem](https://stackoverflow.com/questions/51980686/gradle-sync-failed-premature-end-of-content-length-delimited-message-body-expe) - one respondent says they are using a VPN. Are you using a VPN to connect to the internet? – halfer Apr 18 '20 at 11:04
  • Possibly related: https://github.com/flutter/flutter/issues/19614 – halfer Apr 18 '20 at 11:05
  • I am doing it with my mobile hotspot – Grb Apr 18 '20 at 11:14
  • I have searched everywhere but not getting any solution. But at one place there was a sol where they were just overwriting a fcode in some gradle file. My only problem is that I dont know how to open a gradle file – Grb Apr 18 '20 at 11:15
  • If u know how to open a gradle file I can try that solution – Grb Apr 18 '20 at 11:16
  • Do you have another connection to hand? Mobile data plans can vary enormously in quality. Or if you are not using a VPN, try one - they are encrypted so if the mobile provider is interfering with the connection (e.g. for traffic shaping) then perhaps it can be made more reliable. – halfer Apr 18 '20 at 11:16
  • i dont have any other service right now – Grb Apr 18 '20 at 11:17
  • I always use my mobile hotspot – Grb Apr 18 '20 at 11:17
  • Maybe try [cleaning your project](https://stackoverflow.com/questions/28581211/how-to-project-clean-in-android-studio) so you can do a completely fresh compile. – halfer Apr 18 '20 at 11:19

1 Answers1

-1

Yes. Its a VPN issue. Please disconnect VPN and try, it worked for me.

naga babu
  • 29
  • 2