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

Runtime Dependencies/Complex Example #41

Open
kfrancis opened this issue Jul 30, 2024 · 5 comments
Open

Runtime Dependencies/Complex Example #41

kfrancis opened this issue Jul 30, 2024 · 5 comments
Labels
needs info Requires more information from issue reporter

Comments

@kfrancis
Copy link

kfrancis commented Jul 30, 2024

I've been trying to create a binding for Intercom, but I'm struggling to run it on Android even though it's all building. Can there be a sample that has a deeper dependency tree and includes Android? Right now, the Facebook example is the only Android example but there are no run-time dependencies only compile-time.

Perhaps an example that packs up the work into a plugin? https://github.com/jfversluis/Plugin.Maui.Feature

Links:

@kfrancis
Copy link
Author

kfrancis commented Aug 7, 2024

Started trying to make sense of this here: https://github.com/kfrancis/Plugin.Maui.Intercom

@kfrancis
Copy link
Author

kfrancis commented Aug 7, 2024

Getting closer, able to call initialize but when trying to render the component I'm getting:

Java.Lang.NoClassDefFoundError: 'Failed resolution of: Landroidx/compose/runtime/internal/ComposableLambdaKt;'

Still a mess of dependencies, and the error it's mentioning isn't a direct one but rather transient from one of the material dependencies: https://mvnrepository.com/artifact/io.intercom.android/intercom-sdk-base/15.10.1

2024-08-07-0z7d7

@rachelkang
Copy link
Collaborator

Hi, @kfrancis - thanks for using Maui.NativeLibraryInterop and reporting this issue. It appears that you might be missing some dependencies that your binding library of interest requires. In case it is helpful, I have a sample that includes an Android binding with its dependencies at https://github.com/rachelkang/MauiCharts and more information about my process in a blog post .

@kfrancis
Copy link
Author

@rachelkang I did check the blog post and your source, but I don't see where my issue lies. I mean, Intercom has many runtime dependencies whereas your project is single-dependency. In particular, the compose dependency seems to be more problematic than others - but I'm not sure where I'm going about it wrong.

https://github.com/kfrancis/Plugin.Maui.Intercom/blob/a5e09782ae77924e350290dba262aeda84a5d9cd/src/Plugin.Maui.Feature/Plugin.Maui.Intercom.csproj#L86

https://github.com/kfrancis/Plugin.Maui.Intercom/blob/a5e09782ae77924e350290dba262aeda84a5d9cd/src/android/native/mauiintercom/build.gradle.kts#L39

Any further suggestions? I put the source on github in the hopes that it might be useful to see what's going on in a far more dependency-complex scenario.

@rachelkang
Copy link
Collaborator

Hi, @kfrancis - I recommend double-checking the versions of your dependencies and ensuring they're all compatible with one another / there is no mismatch. If you continue to have issues, I recommend consulting on the issue with the library, as it may be a compatibility issue they have with Android.

Similar Java.Lang.NoClassDefFoundError: 'Failed resolution of: Landroidx/compose/runtime/internal/ type issues seem to commonly be due to version mismatches - e.g. https://stackoverflow.com/questions/66429770/jetpack-compose-fails-with-noclassdeffounderror-failed-resolution-of-landroidx

@rachelkang rachelkang added the needs info Requires more information from issue reporter label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs info Requires more information from issue reporter
Projects
None yet
Development

No branches or pull requests

2 participants