Building ionic v3 apk

hi, I’m trying to build apk for ionic 3 project and I’m having this problem below, any help?
I spent days searching and nothing helps
could it be a connection problem??

  • What went wrong:
    A problem occurred evaluating project ‘:app’.

Could not resolve all files for configuration ‘classpath’.
Could not download protos.jar (com.android.tools.analytics-library:protos:26.6.4)
Could not get resource ‘https://dl.google.com/dl/android/maven2/com/android/tools/analytics-library/protos/26.6.4/protos-26.6.4.jar’.
Premature end of Content-Length delimited message body (expected: 3616391; received: 1843888
Could not download aapt2-proto.jar (com.android.tools.build:aapt2-proto:0.4.0)
Could not get resource ‘https://dl.google.com/dl/android/maven2/com/android/tools/build/aapt2-proto/0.4.0/aapt2-proto-0.4.0.jar’.
Premature end of Content-Length delimited message body (expected: 615321; received: 107033
Could not download apkzlib.jar (com.android.tools.build:apkzlib:3.6.4)
Could not get resource ‘https://dl.google.com/dl/android/maven2/com/android/tools/build/apkzlib/3.6.4/apkzlib-3.6.4.jar’.
Could not GET ‘https://dl.google.com/dl/android/maven2/com/android/tools/build/apkzlib/3.6.4/apkzlib-3.6.4.jar’.
Remote host terminated the handshake

Sounds like a broken network or proxy configuration. Can you try in a different network environment?

1 Like

the problem was caching Gradle so I delete cache files and rebuild
thank you anyway for your reply

1 Like

but now I am having this problem

FAILURE: Build failed with an exception.

  • What went wrong:
    In project ‘app’ a resolved Google Play services library dependency depends on another at an exact version (e.g. “[15.0.
    1]”, but isn’t being resolved to that version. Behavior exhibited by the library will be unknown.

Dependency failing: com.google.android.gms:play-services-stats:15.0.1 -> com.google.android.gms:play-services-basement@[
15.0.1], but play-services-basement version was 16.0.1.

The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
ifact with the issue.
– Project ‘app’ depends onto com.google.android.gms:play-services-location@16.0.0
– Project ‘app’ depends onto com.google.android.gms:play-services-location@15.+
– Project ‘app’ depends onto com.google.android.gms:play-services-maps@16.0.0
– Project ‘app’ depends onto com.google.firebase:firebase-messaging@17.0.+