JakeWharton / sdk-manager-plugin

DEPRECATED Gradle plugin which downloads and manages your Android SDK.
Apache License 2.0
1.41k stars 142 forks source link

PackageResolver fails silently #83

Open ndahlquist opened 8 years ago

ndahlquist commented 8 years ago

We have an issue similar to #82:

./gradlew resolveAllDependencies
Parallel execution with configuration on demand is an incubating feature.
propsFile exists -true
Support library repository outdated. Downloading update...

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
   > Could not resolve all dependencies for configuration ':app:_flavorTestPerformanceCompile'.
      > Could not find com.android.support:support-v4:22.2.1.
        Searched in the following locations:
            file:/usr/local/android-sdk-linux/extras/google/m2repository/com/android/support/support-v4/22.2.1/support-v4-22.2.1.pom
            file:/usr/local/android-sdk-linux/extras/google/m2repository/com/android/support/support-v4/22.2.1/support-v4-22.2.1.jar
        Required by:
            snapchat:app:unspecified
      > Could not find com.android.support:recyclerview-v7:22.2.1.
        Searched in the following locations:
            file:/usr/local/android-sdk-linux/extras/google/m2repository/com/android/support/recyclerview-v7/22.2.1/recyclerview-v7-22.2.1.pom
            file:/usr/local/android-sdk-linux/extras/google/m2repository/com/android/support/recyclerview-v7/22.2.1/recyclerview-v7-22.2.1.jar
        Required by:
            snapchat:app:unspecified
      > Could not find com.android.support:support-v4:22.2.1.
        Searched in the following locations:
            file:/usr/local/android-sdk-linux/extras/google/m2repository/com/android/support/support-v4/22.2.1/support-v4-22.2.1.pom
            file:/usr/local/android-sdk-linux/extras/google/m2repository/com/android/support/support-v4/22.2.1/support-v4-22.2.1.jar
        Required by:
            snapchat:app:unspecified > com.google.android.gms:play-services-safetynet:7.0.0 > com.google.android.gms:play-services-base:7.0.0

One problem is that the sdk download is failing, but no error output is shown by the plugin. It probably makes sense to print a message or throw an exception if the download fails.

The cause of this issue appears to be this, which may be related to #81, though I'm not sure exactly what's going on here:

Do you accept the license 'android-sdk-license-5be876d5' [y/n]: 
Installing Archives:
  Preparing to install archives
  Downloading Android Support Repository, revision 16
     (4%, 1666 KiB/s, 41 seconds left)
     (6%, 1642 KiB/s, 41 seconds left)
     (9%, 1703 KiB/s, 38 seconds left)
     (11%, 1715 KiB/s, 37 seconds left)
     (14%, 1745 KiB/s, 35 seconds left)
     (16%, 1728 KiB/s, 35 seconds left)
     (19%, 1731 KiB/s, 34 seconds left)
     (21%, 1736 KiB/s, 32 seconds left)
     (24%, 1742 KiB/s, 31 seconds left)
     (26%, 1753 KiB/s, 30 seconds left)
     (29%, 1758 KiB/s, 29 seconds left)
     (31%, 1770 KiB/s, 28 seconds left)
     (34%, 1776 KiB/s, 26 seconds left)
     (36%, 1780 KiB/s, 25 seconds left)
     (38%, 1765 KiB/s, 25 seconds left)
     (41%, 1768 KiB/s, 24 seconds left)
     (43%, 1772 KiB/s, 23 seconds left)
     (46%, 1775 KiB/s, 21 seconds left)
     (48%, 1777 KiB/s, 20 seconds left)
     (51%, 1782 KiB/s, 19 seconds left)
     (54%, 1786 KiB/s, 18 seconds left)
     (56%, 1787 KiB/s, 17 seconds left)
     (59%, 1792 KiB/s, 16 seconds left)
     (61%, 1782 KiB/s, 15 seconds left)
     (64%, 1787 KiB/s, 14 seconds left)
     (66%, 1792 KiB/s, 13 seconds left)
     (69%, 1797 KiB/s, 12 seconds left)
     (71%, 1800 KiB/s, 11 seconds left)
     (74%, 1802 KiB/s, 10 seconds left)
     (77%, 1805 KiB/s, 9 seconds left)
     (79%, 1809 KiB/s, 8 seconds left)
     (82%, 1810 KiB/s, 7 seconds left)
     (84%, 1812 KiB/s, 6 seconds left)
     (87%, 1816 KiB/s, 4 seconds left)
     (90%, 1818 KiB/s, 3 seconds left)
     (92%, 1818 KiB/s, 2 seconds left)
     (95%, 1820 KiB/s, 1 seconds left)
     (97%, 1822 KiB/s, 0 seconds left)
     (101%, 1842 KiB/s, 0 seconds left)
  Download finished with wrong size. Expected 74559482 bytes, got 77391866 bytes.
  Done. Nothing was installed.
ndahlquist commented 8 years ago

This might be a related: https://code.google.com/p/android/issues/detail?id=36941.

Also, the sdk-manager-plugin appears to be correctly checking the exit code, so it appears that the android update command is returning 0... nice.