Package 

Object Rive

    • Method Detail

      • init

         final Unit init(Context context, RendererType defaultRenderer)

        Initialises Rive.

        This loads the C++ libraries required to use Rive objects and then makes sure to initialize the C++ environment.

        If you're still running into native loading issues (for example with split APKs / dynamic feature delivery), you can load native libs yourself and then call initializeCppEnvironment.

        System.loadLibrary("rive-android")
        // or if you're using split APKs / dynamic feature delivery:
        SplitInstallHelper.loadLibrary(context, "rive-android")
        Rive.initializeCppEnvironment()

        For split APK / on-demand feature delivery, native libraries can live outside the base APK. In those setups, call SplitInstallHelper.loadLibrary(...) from the split context before calling initializeCppEnvironment. More details: https://developer.android.com/guide/playcore/feature-delivery/on-demand#native-code

        Parameters:
        defaultRenderer - The default renderer to use when initializing File or RiveAnimationView.
      • initializeCppEnvironment

         final static Unit initializeCppEnvironment()

        Initialises the JNI Bindings.

        We update the C++ environment with a pointer to the JavaVM so that it can interact with JVM objects.

        Normally done as part of init, and only required if you are avoiding calling init.