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

[Platform] Difficulty in building Android CHIPTool #27374

Closed
satyajitanand opened this issue Jun 21, 2023 · 2 comments
Closed

[Platform] Difficulty in building Android CHIPTool #27374

satyajitanand opened this issue Jun 21, 2023 · 2 comments
Labels

Comments

@satyajitanand
Copy link
Contributor

satyajitanand commented Jun 21, 2023

I referred android build guide document to build chip-tool: https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/android_building.md
It's mentioned to use Gradle 7.1.1 for all android project and it does not support Java 17.
Based on "https://docs.gradle.org/current/userguide/compatibility.html", Java 16 seems to be right one to use.

However, it looks like that Java 16 is obsolete and major players like Oracle has removed Java 16 download support.
I too faced this issue. I have openjdk 17 version installed which was giving the below 2 build errors when building chip-tool.

  1. Unrecognized VM option 'MaxPermSize=2048m'.
  2. On solving point 1, I got the next error: "java.lang.IllegalArgumentException: Unsupported class file major version 61".

I made a few changes in gradle build files and could able to build chip-tool through openjdk 17.
The is the commit URL: "#27377" (I marked it 'Don't Merge' as intention is to show the required changes to get it review first).

@andy31415 and @bzbarsky-apple : I am not sure if many people facing the similar sort of experience. If you think, the documentation should have such mentioning (to build through openjdk 17) or relevant code should be pushed under "java 17" version check to provide build support, then please help to suggest.

@andy31415
Copy link
Contributor

andy31415 commented Jun 23, 2023

The currently supported way of building java-specific is based on docker file images. At this time the pure java bits at https://github.com/project-chip/connectedhomeip/blob/master/integrations/docker/images/chip-build-java/Dockerfile say:

https://github.com/JetBrains/kotlin/releases/download/v1.8.10/kotlin-compiler-1.8.10.zip
ENV JAVA_PATH=/usr/lib/jvm/java-8-openjdk-amd64

and for chip-tool android we use:

openjdk-8-jdk

with some notes saying that sdkmanager on android does not like jdk11.

I am not sure about the other errors. I expect there is a chance that the build guide is obsolete and I would prefer to change the build guide to reflect reality than trying to change code to adapt to the build guide (I expect code evolved and build guide did not)

@bzbarsky-apple bzbarsky-apple changed the title [Platform] Difficulty in building chip-tool [Platform] Difficulty in building Android CHIPTool Jun 23, 2023
@yunhanw-google
Copy link
Contributor

we have upgraded the android build with java 17 and gradle 7.3.3, and kotlin 2.0.
#33837, this issue should be resolved, feel free to reopen a new case if this is still problematic. thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants