mindrunner / docker-android-sdk

GNU General Public License v3.0
277 stars 169 forks source link

Builds fail with gradle 3.6.1 #56

Closed mattilindell closed 4 years ago

mattilindell commented 4 years ago

Builds fail in bitbucket CI when using

image: runmymind/docker-android-sdk:latest

build.gradle: classpath 'com.android.tools.build:gradle:3.6.1'

gradle-wrapper.properties: distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip

With error message: No version of NDK matched the requested version 20.0.5594570. Versions available locally: 21.0.6113669

Builds work okay with 3.5.3

mattilindell commented 4 years ago

Related: https://github.com/gradle/gradle/issues/12440 https://github.com/actions/virtual-environments/issues/578

mindrunner commented 4 years ago

No version of NDK matched the requested version 20.0.5594570. Versions available locally: 21.0.6113669

I wonder why it is looking for an older version of the NDK. Do you have an idea? Are you using NDK? Any idea how to fix this?

mattilindell commented 4 years ago

I'm not using NDK. Builds seem to trigger this when upgrading to grade 3.6.0+ as stated in https://github.com/gradle/gradle/issues/12440.

mindrunner commented 4 years ago

I don't see how this is an issue specifically to this project. Seems like there is a bug or something in gradle>=3.6.0.

If you can fix it to make the image working around it, I am happt to accept a PR. Otherwise you should follow the workarounds everyone else does.

mattilindell commented 4 years ago

This seems to be the root cause for me https://issuetracker.google.com/issues/148189425

mattilindell commented 4 years ago

For reference our project was depending on native libraries and Gradle 3.6.1 "uses NDK to strip the .so files to reduce APK size" https://issuetracker.google.com/issues/148189425.

Explicitly specifying NDK version available in the image seems to fix this issue for now

build.gradle: android { ndkVersion "21.0.6113669" }

mindrunner commented 4 years ago

Cool, thanks for the information. is 21.0.6113669 the most recent NDK version, or do we need to update it?