Error: NativeMobile Lotties

Description

If you migrate a Knowledge Base with WorkWithPlus for Native Mobile initialized in a GeneXus version previous to GeneXus 18 upgrade 7, to GeneXus 18 upgrade 7 (or higher), you will get the following error in Android at runtime, when the application launches:

 FATAL EXCEPTION: main
 Process: <<YOUR PACKAGE ID>>, PID: 6884
 java.lang.ArrayIndexOutOfBoundsException: length=10; index=10
      at com.airbnb.lottie.model.content.GradientColor.lerp(GradientColor.java:37)
      at com.airbnb.lottie.animation.keyframe.GradientColorKeyframeAnimation.getValue(GradientColorKeyframeAnimation.java:19)

This error occurs because in GeneXus 18 upgrade 7 the library used by GeneXus to implement Lotties (https://github.com/airbnb/lottie-android) was updated from version '3.4.1' to version '6.1.0' (SAC #53578).

This particular version of the Lotties library contains a reported issue with certain lottie files (https://github.com/airbnb/lottie-android/issues/2298), which affects one of the lottie animations distributed in WorkWithPlus for Native Mobile: SkeletonList

    .ListForm
    {
        gx-loading-animation-class: SkeletonList;
    }

 

Solution 1: Run the Design System Wizard

Execute WorkWithPlus for Native Mobile Design System Wizard. By doing this, our  wizard will detect GeneXus Version and modify the Design System to use a different animation

    .ListForm
    {
        gx-loading-animation-class: SkeletonContent;
    }

Solution 2: Manually patch the Desing System

You can manually modify the Design System, simply open the Design System Object: "WorkWithPlus.NativeMobile.WorkWithPlusDSNative", and search for the class "ListForm", and apply the fix:

    .ListForm
    {
        //gx-loading-animation-class: SkeletonList;
        gx-loading-animation-class: SkeletonContent;
    }

Solution 3: Update GeneXus Lotties library reference (not recommended)

This issue has been solved in Lottie library version 6.2.0: https://github.com/airbnb/lottie-android/releases/tag/v6.2.0

If you want to keep the 'SkelettonList' animation, you can modify the library reference (at your own risk):

In order to accomplish this, you must modify the following files, by changing the version numbers from "6.1.0" to "6.2.0": 

  • <<GeneXus Installation Folder>>\Android\m2Repository\com\genexus\android\AnimationLib\2.0.1\AnimationLib-2.0.1.pom
    <dependency>
      <groupId>com.airbnb.android</groupId>
      <artifactId>lottie</artifactId>
      <version>6.1.0</version>
      <scope>runtime</scope>
    </dependency>
  • <<GeneXus Installation Folder>>\Android\m2Repository\com\genexus\android\AnimationLib\2.0.1\AnimationLib-2.0.1.module
        {
          "group": "com.airbnb.android",
          "module": "lottie",
          "version": {
            "requires": "6.1.0"
          }
        },