Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build and test through. Android-27 , build-tools-27.0.2 #8874

Closed
XinyueZ opened this issue Dec 8, 2017 · 15 comments
Closed

Can't build and test through. Android-27 , build-tools-27.0.2 #8874

XinyueZ opened this issue Dec 8, 2017 · 15 comments
Labels

Comments

@XinyueZ
Copy link

XinyueZ commented Dec 8, 2017

Can any one help me?

Stuck from my side.

https://travis-ci.org/XinyueZ/mvvm-template/jobs/313586340

I can 't build (./gradlew test) it.

my yml is

language: android
android:
  components:
    - tools
    - platform-tools
    - build-tools-27.0.2
    - android-27
    - add-on
    - extra
licenses:
    - 'android-sdk-license-.+'
jdk:
    - oraclejdk8
script:
    - ./gradlew :repository:testMockDebugUnitTest :repository:testProdDebugUnitTest :repository:testProdReleaseUnitTest
before_cache:
    - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
cache:
  directories:
    - $HOME/.m2
    - $HOME/.gradle/caches/
    - $HOME/.gradle/wrapper/
    buildToolsVersion = '27.0.2'

I have tried 27.0.1 as well, same failed.

I had one or three times successed, just 2 hours later, something went wrong.

same yml, no change.

@magneticflux-
Copy link

magneticflux- commented Dec 8, 2017

I encountered the same issue.

The error:

Installing Archives:
  Preparing to install archives
  Downloading SDK Platform Android 8.1.0, API 27, revision 1
  Download finished with wrong size. Expected 65606517 bytes, got 65738431 bytes.
  Done. Nothing was installed.

My build log: https://travis-ci.org/Pattonville-App-Development-Team/Android-App/builds/313576794

StackOverflow question: https://stackoverflow.com/a/47719835/9073728

@cotsog
Copy link

cotsog commented Dec 8, 2017

It seems Google uploaded a new version of the android-27 package and the checksum is now different and the download fails. It might be caused because we are using the old android CLI to install the Android SDKs under the hood. I'm not sure how fast we'll be able to fix that but in the meantime, I was wondering if you could try to install it yourself using the sdkmanager CLI instead? Here's what you would need to add to your .travis.yml file:

before_install:
  - yes | sdkmanager "platforms;android-27"

Please let us know if this helps or not.

Thanks!

@magneticflux-
Copy link

@cotsog It looks like that fixed it!

Here's my first successful build: https://travis-ci.org/Pattonville-App-Development-Team/Android-App/builds/313658277

@XinyueZ
Copy link
Author

XinyueZ commented Dec 8, 2017

it works, thanks to all .

@XinyueZ XinyueZ closed this as completed Dec 8, 2017
@XinyueZ
Copy link
Author

XinyueZ commented Dec 8, 2017

@cotsog It works, however, we need final solution.

wongsyrone referenced this issue in shadowsocks/shadowsocks-android Dec 9, 2017
@nagkumar
Copy link

nagkumar commented Dec 9, 2017

where is .travis.yml this file located..

@magneticflux-
Copy link

@nagkumar I placed it after android components and before script. I don't think it matters though since they're all labeled.

@msridhar
Copy link

Should this issue be re-opened until there is a proper fix?

@XinyueZ
Copy link
Author

XinyueZ commented Dec 11, 2017

I reopen

@XinyueZ XinyueZ reopened this Dec 11, 2017
nitzanj added a commit to cloudinary/cloudinary_android that referenced this issue Dec 31, 2017
nitzanj added a commit to cloudinary/cloudinary_android that referenced this issue Jan 1, 2018
fornwall added a commit to termux/termux-app that referenced this issue Jan 1, 2018
cesine added a commit to cesine/AndroidFieldDB that referenced this issue Jan 2, 2018
thearaks added a commit to thearaks/GoIV that referenced this issue Jan 15, 2018
thearaks added a commit to thearaks/GoIV that referenced this issue Jan 15, 2018
thearaks added a commit to thearaks/GoIV that referenced this issue Jan 15, 2018
barbeau added a commit to OneBusAway/onebusaway-android that referenced this issue Jan 18, 2018
barbeau added a commit to OneBusAway/onebusaway-android that referenced this issue Jan 18, 2018
* Use srcCompat for vector drawables as specified by Lint
* Remove obsolete <uses-amzn-sdk> tag - See https://forums.developer.amazon.com/articles/90051/removing-the-tag-from-your-android-manifest.html
* Bump compileSdkVersion to 27, fix loading bike drawable on API <= 19
* Add leftover import changes from vector drawable API 19 fix
* Bump Travis to API Level 27
* Fix Travis license issue - Based on travis-ci/travis-ci#8874
* Override ES SDK social comment icon with PNG instead of vector - As discussed in #835, it seems that an XML vector drawable doesn't properly override a library PNG drawable with the same name.  So, we'll switch to using PNGs for this in the application.  Using this method, Android Studio still shows the library icon when looking at the layouts in OBA Android, but when running the app the correct PNG drawables from the OBA app are shown.

Posts that were useful in resolving issues:
* https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html#aapt2_resource_naming
* https://stackoverflow.com/questions/44239235/android-gradle-3-0-0-alpha2-plugin-cannot-set-the-value-of-read-only-property/44265374#44265374
* https://stackoverflow.com/a/47132142/937715
* https://stackoverflow.com/questions/42374151/all-com-android-support-libraries-must-use-the-exact-same-version-specification
@kfieldi5
Copy link

This should be re-opened. Still no proper fix.

@eduardomoroni
Copy link

Yes, Just created a new pipeline. Failed over and over. Only way to make it works was:

      android:
        components:
          - build-tools-26.0.2
          - android-26

      before_install:
        - yes | sdkmanager "platforms;android-26"

hrishikesh-kadam added a commit to codetoart/FolioReader-Android that referenced this issue Jun 29, 2018
GuillemRoca added a commit to GuillemRoca/Matisse that referenced this issue Aug 13, 2018
jschenkDD pushed a commit to jschenkDD/MyTrainStation that referenced this issue Aug 22, 2018
regisb added a commit to overhangio/tutor that referenced this issue Jan 19, 2019
For some reason, the license was not accepted anymore. Fixed by
following the recommended solution in:
travis-ci/travis-ci#8874
regisb added a commit to overhangio/tutor that referenced this issue Jan 19, 2019
For some reason, the license was not accepted anymore. Fixed by
following the recommended solution in:
travis-ci/travis-ci#8874
jasta added a commit to jasta/stetho that referenced this issue Mar 18, 2019
jasta added a commit to jasta/stetho that referenced this issue Mar 18, 2019
randytarampi added a commit to randytarampi/react-native-appium that referenced this issue Apr 18, 2019
Travis is still using the deprecated `android` command to install things per travis-ci/travis-ci#8874 (comment), which might be behind this issue (and others to come).
randytarampi added a commit to randytarampi/react-native-appium that referenced this issue Apr 18, 2019
randytarampi added a commit to randytarampi/react-native-appium that referenced this issue Apr 22, 2019
Travis is still using the deprecated `android` command to install things per travis-ci/travis-ci#8874 (comment), which might be behind this issue (and others to come).
randytarampi added a commit to randytarampi/react-native-appium that referenced this issue Apr 22, 2019
randytarampi added a commit to randytarampi/react-native-appium that referenced this issue Apr 22, 2019
Travis is still using the deprecated `android` command to install things per travis-ci/travis-ci#8874 (comment), which might be behind this issue (and others to come).
randytarampi added a commit to randytarampi/react-native-appium that referenced this issue Apr 22, 2019
randytarampi added a commit to randytarampi/react-native-appium that referenced this issue Apr 22, 2019
* Try hooking this up all up in Travis.

Two jobs, one to run the unit tests and one to run the E2E ones headlessly on Travis infrastructure. Tempted to add jobs to build and run against BrowserStack, Sauce Labs and TestObject, but one thing at a time first...

@hadnazzar already committed the dummy credentials in `android/gradle.properties` though, so it's not like having Travis decrypt this committed keystore will be more secure or anything. If anything, it's worse 😂

* Just install Android SDK dependencies ourselves.

Travis is still using the deprecated `android` command to install things per travis-ci/travis-ci#8874 (comment), which might be behind this issue (and others to come).

* Actually, just prefer letting Travis install these (properly).

Copy/pasta problems coming from the `sdkmanager` command notation - `android` should still be able to find these versions no?

* Try for `ANDROID_BUILD_TOOLS_VERSION` at 28.0.3.

* `npm install -g yarn` `before_install` on `E2E tests (android)`.

* Use the given `nvm` to install `$TRAVIS_NODE_VERSION`.

Travis still sets this right? I mean, the version is in the build name...

* Defer to `TRAVIS_NODE_VERSION` if it exists, otherwise use `10`.

* Explicitly say `yes` to all `sdkmanager --licenses`.

* Just explicitly install the Android SDK per travis-ci/travis-ci#8874 (comment).

Why wasn't this license already accepted?

* Explicitly call `$ANDROID_HOME/tools/bin/sdkmanager`.

And accept all licenses.

* Remove extra slash.

* `${ANDROID_HOME}` is what needs to be evaluated, not `$ANDROID_HOMEtools`

* This wanted to be a space, not a `"`.

* Whitelist all the licenses, even though it shouldn't matter...

* Set `supportLibVersion` to be the same as `buildToolsVersion`.

* Move `node_js` language/version selection to the `Unit tests` job.

* Revert "Set `supportLibVersion` to be the same as `buildToolsVersion`."

Yeah. No.

This reverts commit 6fd8f25.

* Just `echo` in the license manually...

* Run `build:android`, not `bs:android`.

* Actually specify the correct `ANDROID_API_VERSION`.

And use `android create avd` and `android delete avd` instead of `avdmanager`, which doesn't seem to get installed properly.

* `pree2e` script should `adb wait-for-device get-serialno`.

* Note the closest I got to getting Travis to run the app on an emulator.

I'm pretty sure I'm just running into a race condition somewhere installing the app, but I can't quite tell exactly where, or what to wait for.

* Just bring our own Android environment per https://medium.com/@nocnoc/android-emulators-in-thcloud-f39e11c15bfa.

It boots the emulators, but getting Appium to install the emulators is a whole other story...

* Fix missing `ANDROID_TOOLS_BUILD_VERSION` and incorrect `ANDROID_EMULATOR_PLATFORM_VERSION`.

* Define `ANDROID_HOME` and `ANDROID_SDK_ROOT` in `before_install`.

Not `before_script`.

* Try testing with `android-23` on `armeabi-v7a`.

* Try and let `appium` boot and initialize the emulator on its own.

* Only `sleep` for at most 60 seconds `beforeAll` `wd` E2E tests.

* Set Travis timeouts to be 10 minutes.

Worth a shot I guess?

* Revert "Only `sleep` for at most 60 seconds `beforeAll` `wd` E2E tests."

Just defer to the `DEVICE_TIMEOUT` here.

This reverts commit 4f1416c.

* Don't bother caching `gradle` artifacts.

* Just boot the emulator ourselves.

This commit reverts (conceptually) 4ae60c0.

* `sdkmanager` installs `tools` on its own, to avoid `sdkmanager` errors.

I don't know why it can't find `tools` sometimes, but this seems to help.

* I think the whitespace here is tripping Travis up. It finds `tools` just fine when I copy/paste this file in...

* Travis allows the local E2E Android tests to fail.

* Add a separate `E2E` stage.
@mochadwi
Copy link

mochadwi commented Jun 2, 2019

Please re-open this. I still can't succeed my build in travis-ci

https://api.travis-ci.com/v3/job/204776450/log.txt?log.token=4ZVjWxhbLWwpDzxFgtM5pg

REBOOTERS pushed a commit to zhihu/Matisse that referenced this issue Sep 11, 2019
* Change button sure for apply like before since has more translations and make more sense.

* Fix travis for API 27. See issue: travis-ci/travis-ci#8874

* Revert last commit
moodcal pushed a commit to moodcal/Matisse that referenced this issue Mar 7, 2020
* Change button sure for apply like before since has more translations and make more sense.

* Fix travis for API 27. See issue: travis-ci/travis-ci#8874

* Revert last commit
@Grandolf49
Copy link

It seems Google uploaded a new version of the android-27 package and the checksum is now different and the download fails. It might be caused because we are using the old android CLI to install the Android SDKs under the hood. I'm not sure how fast we'll be able to fix that but in the meantime, I was wondering if you could try to install it yourself using the sdkmanager CLI instead? Here's what you would need to add to your .travis.yml file:

before_install:
  - yes | sdkmanager "platforms;android-27"

Please let us know if this helps or not.

Thanks!

Thanks @cotsog It worked! Been stuck on this for hours, finally your solution worked!

@amusa07
Copy link

amusa07 commented Oct 20, 2020

After installation of latest Android SDK I found out that Android\android-sdk\platforms\android-28
I copied: Android\android-sdk\platforms\android-28 Android\android-sdk\platforms\android-27
As a result it works

AdamMickiewich pushed a commit to VolyaTeam/dzida-app that referenced this issue Aug 8, 2022
shrihankp pushed a commit to reisxd/termux-app that referenced this issue Oct 20, 2022
frikke pushed a commit to frikke/termux-app that referenced this issue Aug 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants