CircleCI-Public / cimg-android

The CircleCI Android Docker Convenience Image.
MIT License
72 stars 37 forks source link

Use specific java versions? #70

Closed dessalines closed 1 year ago

dessalines commented 1 year ago

A linting plugin https://github.com/jeremymailen/kotlinter-gradle , requires java 17 to run. That means I can't use this image to run lints anymore.

JalexChen commented 1 year ago

At the moment, it doesn't seem like full support is available for Java 17 - it might just be Android Studio and that is through an embedded jdk. We'll keep an eye on this as more information surfaces. Putting this in the backlog for now.

dessalines commented 1 year ago

Thanks. For info, my log error for weeks has been:

* What went wrong:
An exception occurred applying plugin request [id: 'com.android.application']
> Failed to apply plugin 'com.android.internal.application'.
   > Android Gradle plugin requires Java 17 to run. You are currently using Java 11.
      Your current JDK is located in /usr/lib/jvm/java-11-openjdk-amd64
      You can try some of the following options:
       - changing the IDE settings.
       - changing the JAVA_HOME environment variable.
       - changing `org.gradle.java.home` in `gradle.properties`.

* 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.
laenger commented 1 year ago

https://developer.android.com/studio/preview/features/#jdk-17-agp

When using Android Gradle Plugin 8.0 to build your app, JDK 17 is now required to run Gradle.

Mygod commented 1 year ago

This should be supported since the next AGP has already hit beta...

JalexChen commented 1 year ago

hi @laenger and @Mygod - we're looking into this and will have an update weds 3/8 if not sooner. I think it's the correct call to include java 17, especially since it's the latest LTS version, AGP 8.0 requires it, and it coincides with official support from android in the latest developer version, which will be packaged in the next release.

my previous comment was specifically targeted towards android studio, which does include java 17 embedded. however, this is not an android studio image.

while i understand it can also be an extra step, installing the openjdk-17-jdk package or using the android-orb to change java's version might be an alternative until then.

thanks for being patient with us.

Mygod commented 1 year ago

Still no release?

ryanbourdais commented 1 year ago

Hi @Mygod I am currently working on the machine executor release as well, once that is done I will publish both so that there is parity between the 2 options.

ryanbourdais commented 1 year ago

@Mygod @dessalines I have released the new docker image today as cimg/android:2023.03.1 and the machine executor has been released as android:edge for the time being. Both of these releases feature replacing Java 11 with Java 17

dessalines commented 1 year ago

Thanks!

dessalines commented 1 year ago

edit: Now I'm getting permissions errors with this new image:

Failed to create parent directory '/.../.gradle' when creating directory '/.../.gradle/vcs-1'

agustinsivoplas commented 1 year ago

@dessalines Do you have a solution?

I am using: android:2023.04

I have this error:

Bundler::PermissionError There was an error while trying to write to/var/lib/gems/3.0.0/cache/CFPropertyList-3.0.3.gem. It is likely that you need to grant write permissions for that path.

cc: @ryanbourdais

dessalines commented 1 year ago

I haven't found one unfortunately. I'm currently only doing formatting checks in my CI, not building images anymore.

agustinsivoplas commented 1 year ago

Same issue happens with cimg/android:2023.04.1