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

[Documentation] android_building.md should be updated after SDK and NDK version changes. #25987

Open
andy31415 opened this issue Apr 5, 2023 · 12 comments
Assignees

Comments

@andy31415
Copy link
Contributor

Documentation issues

https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/android_building.md

needs to describe how to build using the latest NDK/SDK versions.

Platform

android

Anything else?

No response

@tetedoie
Copy link

tetedoie commented Apr 5, 2023

We also need to update the container version (to 0.7.0) used by this Github actions

image: connectedhomeip/chip-build-android:0.6.51
like in this other Github action https://github.com/ksperling-apple/connectedhomeip/blob/4d75d75d11b0ec2563031d8e583b8af3ee40d47f/.github/workflows/smoketest-android.yaml#L41

@ksperling-apple
Copy link
Contributor

I included the update to the workflow in this PR that depends on it: #25939

@bzbarsky-apple
Copy link
Contributor

bzbarsky-apple commented Apr 5, 2023

@ksperling-apple The comment above is about the other Android workflow: .github/workflows/full-android.yaml

@ksperling-apple
Copy link
Contributor

ksperling-apple commented Apr 5, 2023

Looks like the SDK version is 26 now instead of 21 since #25204 so that's wrong now too.

I don't have Android Studio installed to check what the exact revision numbers currently are though. There seem to be extra revision numbers there when installing via Android Studio compared to the NDK downloads page.

@tetedoie
Copy link

tetedoie commented Apr 6, 2023

I don't have Android Studio installed to check what the exact revision numbers currently are though. There seem to be extra revision numbers there when installing via Android Studio compared to the NDK downloads page.

If the new NDK version is r23c (#25952), it correspond to 23.2.8568313 in android studio (https://github.com/android/ndk/wiki/Unsupported-Downloads#r23c). I tested and it's working (when built from scripts)

@tetedoie
Copy link

tetedoie commented Apr 7, 2023

It seems that the ndk version must be specified in the android config or the generated .cxx/ndk_locator_record file is still referencing version 21.4.7075529.

@tetedoie
Copy link

tetedoie commented Apr 7, 2023

Looks like the SDK version is 26 now instead of 21 since #25204 so that's wrong now too.

How do we know the SDK version when built from scripts ? (I'm assuming we are referring here to the min SDK requirement to build the AndroidPlatform.jar)

When building from source, the minSdkVersion of the chip-library module is currently 24.

@tetedoie
Copy link

tetedoie commented Apr 7, 2023

I think we should also update this section entirely and/or fix the Gradle scripts.

I'm wondering if anyone is able to compile when strictly following those instructions without facing #25774, #21880, #23186 and #23341 (The two last are the same, they are just warnings and goes away when using NDK 23.2.8568313)

I'm able to build from source but I have to change the Gradle scripts from CHIPTool's app and chip-library modules (Moving the NDK settings from app to chip-library and change the main sourceSet paths of chip-library module. There are also missing dependencies in third_party/android_deps/android_deps.gradle).

@srdantas
Copy link

srdantas commented May 8, 2023

same problem... @tetedoie can you share your solution?
I try to force version of NDK (i do no how it works) setting property ndkVersion in build.gradle, after the build broken in compileDebugKotlin, with a lot of errors like Unresolved reference: chip.

Update: I got work on android project when set matterSdkSourceBuild to false...

@karlp
Copy link
Contributor

karlp commented Jun 14, 2023

I'm stuck here too, the android studio SDK is now 17.x as well, so the gradle 7.1.1 builds in the v1.1branch builds all fail with Unsupported class file major version 61

@karlp
Copy link
Contributor

karlp commented Jun 14, 2023

FWIW, I finally got it to build after editing examples/android/CHIPTool/app/build/outputs/apk/debug/app-debug.apk to use the 7.0.0 gradle plugin (based on information from https://stackoverflow.com/a/70807648) and also updating examples/android/CHIPTool/gradle/wrapper/gradle-wrapper.properties and third_party/android_deps/gradle/wrapper/gradle-wrapper.properties to use gradle 7.3.3, which supports java 17.

After all that, the app is still..... well, it's an app, but that's unrelated to getting it to build :)

@joonhaengHeo
Copy link
Contributor

@yunhanw-google What is the final goal of this open issue?

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

No branches or pull requests

7 participants