Skip to content

Crash on Android: IncompatibleClassChangeError in FunctionExpand when calling integrate(sin(x^2)) #3

@Mohsin0855

Description

@Mohsin0855

Hi, I’m using Symja in an Android project and encountering a crash when trying to evaluate:
integrate(sin(x^2))

Simpler integrals like integrate(sin(x)) work fine, but with sin(x^2) the app crashes.

Crash log excerpt:
java.lang.IncompatibleClassChangeError: Class 'com.google.common.base.Suppliers$NonSerializableMemoizingSupplier'
does not implement interface 'java.util.function.Supplier'
at org.matheclipse.core.reflection.system.FunctionExpand.getMatcher(FunctionExpand.java:599)
Details about my setup:

  • I have implemented Symja using the provided modules in my Android project (added them at the module level)
  • Other expressions evaluate correctly. The crash only occurs on certain advanced integrals like integrate(sin(x^2)).

From my debugging, it looks like a Guava version conflict:

  • On Android, com.google.common.base.Suppliers comes from the runtime (older Guava version).
  • But FunctionExpand seems to expect a newer version where Suppliers.NonSerializableMemoizingSupplier implements java.util.function.Supplier.

Questions:

  1. Is this a known issue with Guava on Android?
  2. Should we explicitly exclude Guava from Symja and instead use a newer com.google.guava:guava-android dependency?
  3. What’s the recommended fix or workaround to make integrate(sin(x^2)) work on Android without crashes?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions