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

Updates to ARCore 1.46.0 and filament 1.56.0 and kotlin 2 and API 35 #581

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kmayoral
Copy link
Contributor

While inspecting an app I work on, I noticed that some of our packaged native shared libraries were not aligned to support 16KB page sizes which are now a possibility with Android 15.

Specifically the filament and gltfio libraries:

/var/folders/tt/grg_b0zj2pbd225l8k92n62c0000gq/T/app-bird-debug_out_XXXXX.odz7PXG5ux/lib/arm64-v8a/libgltfio-jni.so: \e[31mUNALIGNED\e[0m (2**12)
/var/folders/tt/grg_b0zj2pbd225l8k92n62c0000gq/T/app-bird-debug_out_XXXXX.odz7PXG5ux/lib/arm64-v8a/libfilament-jni.so: \e[31mUNALIGNED\e[0m (2**12)

To fix this, we would need to update to a newer version of Filament and a newer version of AGP so that when the project was rebuilt, the libraries would be properly aligned.

While making those changes, I went ahead and updated other dependencies listed below:
Compile/Target SDK 34 -> 35
Kotlin 1.9.24 -> 2.0.21
Gradle 8.7 -> 8.9
AGP 8.4.1 -> 8.7.2
Compose Plugin 2.0.21
ARCore 1.43.0 -> 1.46.0
Filament 1.52.0 -> 1.56.0

Since this involved a material version change, I went ahead and updated the materials that are included in the AAR libraries (but I may not have updated all the materials referenced in various sample projects).

Regenerated various materials:

➜  bin git:(v1.56.0) ./matc -o /Users/keith.mayoral/git_repos/sceneview-android/arsceneview/src/main/assets/materials/camera_stream_depth.filamat /Users/keith.mayoral/git_repos/sceneview-android/arsceneview/src/main/materials/camera_stream_depth.mat 
➜  bin git:(v1.56.0) ./matc -o /Users/keith.mayoral/git_repos/sceneview-android/arsceneview/src/main/assets/materials/camera_stream_flat.filamat /Users/keith.mayoral/git_repos/sceneview-android/arsceneview/src/main/materials/camera_stream_flat.mat
➜  bin git:(v1.56.0) ./matc -o /Users/keith.mayoral/git_repos/sceneview-android/arsceneview/src/main/assets/materials/face_mesh.filamat /Users/keith.mayoral/git_repos/sceneview-android/arsceneview/src/main/materials/face_mesh.mat
➜  bin git:(v1.56.0) ./matc -o /Users/keith.mayoral/git_repos/sceneview-android/arsceneview/src/main/assets/materials/face_mesh_occluder.filamat /Users/keith.mayoral/git_repos/sceneview-android/arsceneview/src/main/materials/face_mesh_occluder.mat
➜  bin git:(v1.56.0) ./matc -o /Users/keith.mayoral/git_repos/sceneview-android/arsceneview/src/main/assets/materials/plane_renderer.filamat /Users/keith.mayoral/git_repos/sceneview-android/arsceneview/src/main/materials/plane_renderer.mat
➜  bin git:(v1.56.0) ./matc -o /Users/keith.mayoral/git_repos/sceneview-android/arsceneview/src/main/assets/materials/plane_renderer_shadow.filamat /Users/keith.mayoral/git_repos/sceneview-android/arsceneview/src/main/materials/plane_renderer_shadow.mat
➜  bin git:(v1.56.0) ./matc --optimize-size --platform=mobile -o /Users/keith.mayoral/git_repos/sceneview-android/arsceneview/src/main/assets/materials/camera_stream_depth.filamat /Users/keith.mayoral/git_repos/sceneview-android/arsceneview/src/main/materials/camera_stream_depth.mat 
➜  bin git:(v1.56.0) ./matc --optimize-size --platform=mobile -o /Users/keith.mayoral/git_repos/sceneview-android/arsceneview/src/main/assets/materials/camera_stream_flat.filamat /Users/keith.mayoral/git_repos/sceneview-android/arsceneview/src/main/materials/camera_stream_flat.mat
➜  bin git:(v1.56.0) ./matc --optimize-size --platform=mobile -o /Users/keith.mayoral/git_repos/sceneview-android/arsceneview/src/main/assets/materials/face_mesh.filamat /Users/keith.mayoral/git_repos/sceneview-android/arsceneview/src/main/materials/face_mesh.mat  
➜  bin git:(v1.56.0) ./matc --optimize-size --platform=mobile -o /Users/keith.mayoral/git_repos/sceneview-android/arsceneview/src/main/assets/materials/face_mesh_occluder.filamat /Users/keith.mayoral/git_repos/sceneview-android/arsceneview/src/main/materials/face_mesh_occluder.mat
➜  bin git:(v1.56.0) ./matc --optimize-size --platform=mobile -o /Users/keith.mayoral/git_repos/sceneview-android/arsceneview/src/main/assets/materials/plane_renderer.filamat /Users/keith.mayoral/git_repos/sceneview-android/arsceneview/src/main/materials/plane_renderer.mat
➜  bin git:(v1.56.0) ./matc --optimize-size --platform=mobile -o /Users/keith.mayoral/git_repos/sceneview-android/arsceneview/src/main/assets/materials/plane_renderer_shadow.filamat /Users/keith.mayoral/git_repos/sceneview-android/arsceneview/src/main/materials/plane_renderer_shadow.mat

and

➜  bin git:(v1.56.0) ./matc --optimize-size --platform=mobile -o /Users/keith.mayoral/git_repos/sceneview-android/sceneview/src/main/assets/materials/image_texture.filamat /Users/keith.mayoral/git_repos/sceneview-android/sceneview/src/main/materials/image_texture.mat
➜  bin git:(v1.56.0) ./matc --optimize-size --platform=mobile -o /Users/keith.mayoral/git_repos/sceneview-android/sceneview/src/main/assets/materials/opaque_colored.filamat /Users/keith.mayoral/git_repos/sceneview-android/sceneview/src/main/materials/opaque_colored.mat
➜  bin git:(v1.56.0) ./matc --optimize-size --platform=mobile -o /Users/keith.mayoral/git_repos/sceneview-android/sceneview/src/main/assets/materials/opaque_textured.filamat /Users/keith.mayoral/git_repos/sceneview-android/sceneview/src/main/materials/opaque_textured.mat
➜  bin git:(v1.56.0) ./matc --optimize-size --platform=mobile -o /Users/keith.mayoral/git_repos/sceneview-android/sceneview/src/main/assets/materials/transparent_colored.filamat /Users/keith.mayoral/git_repos/sceneview-android/sceneview/src/main/materials/transparent_colored.mat
➜  bin git:(v1.56.0) ./matc --optimize-size --platform=mobile -o /Users/keith.mayoral/git_repos/sceneview-android/sceneview/src/main/assets/materials/transparent_textured.filamat /Users/keith.mayoral/git_repos/sceneview-android/sceneview/src/main/materials/transparent_textured.mat
➜  bin git:(v1.56.0) ./matc --optimize-size --platform=mobile -o /Users/keith.mayoral/git_repos/sceneview-android/sceneview/src/main/assets/materials/video_texture_chroma_key.filamat /Users/keith.mayoral/git_repos/sceneview-android/sceneview/src/main/materials/video_texture_chroma_key.mat
➜  bin git:(v1.56.0) ./matc --optimize-size --platform=mobile -o /Users/keith.mayoral/git_repos/sceneview-android/sceneview/src/main/assets/materials/video_texture.filamat /Users/keith.mayoral/git_repos/sceneview-android/sceneview/src/main/materials/video_texture.mat
➜  bin git:(v1.56.0) ./matc --optimize-size --platform=mobile -o /Users/keith.mayoral/git_repos/sceneview-android/sceneview/src/main/assets/materials/view_renderable.filamat /Users/keith.mayoral/git_repos/sceneview-android/sceneview/src/main/materials/view_renderable.mat
Ignoring config entry (unknown key): "defines"
➜  bin git:(v1.56.0) ./matc --optimize-size --platform=mobile -o /Users/keith.mayoral/git_repos/sceneview-android/sceneview/src/main/assets/materials/view_renderable.filamat /Users/keith.mayoral/git_repos/sceneview-android/sceneview/src/main/materials/view_renderable.mat
Ignoring config entry (unknown key): "defines"
➜  bin git:(v1.56.0) ./matc --optimize-size --platform=mobile -o /Users/keith.mayoral/git_repos/sceneview-android/sceneview/src/main/assets/materials/view_texture_lit.filamat /Users/keith.mayoral/git_repos/sceneview-android/sceneview/src/main/materials/view_texture_lit.mat
Ignoring config entry (unknown key): "defines"
➜  bin git:(v1.56.0) ./matc --optimize-size --platform=mobile -o /Users/keith.mayoral/git_repos/sceneview-android/sceneview/src/main/assets/materials/view_texture_unlit.filamat /Users/keith.mayoral/git_repos/sceneview-android/sceneview/src/main/materials/view_texture_unlit.mat

and regenerated environments:

./cmgen --deploy ./output --format=ktx --size=256 --extract-blur=0.1 /Users/keith.mayoral/git_repos/sceneview-android/sceneview/src/main/environments/neutral.hdr 

I used examples of the matc and cmgen commands referenced in this repo to generate the commands I listed above.

Anyways, this may be an incomplete PR if I missed some materials but I wanted to provide it in case it was useful for ongoing migration efforts.

- Crash in SceneView when calling pickNode() which can throw an exception but isn’t caught when destroying the view
- Crash in ArSceneView when view is destroying that could be attempting to double destroy
@kmayoral
Copy link
Contributor Author

I see I also included another commit we have been using in our local build of the libraries to handle some crashes we would see in production via our Crashlytics logs. Those changes addressed our issues so it might be useful in general but feel free to push back there.

Thanks again for an awesome library as always!

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

Successfully merging this pull request may close these issues.

1 participant