Lottie animation (lottie-6.4.0.aar) error “ExecutionException: java.lang.NoClassDefFoundError: Failed resolution of: Lokio/Okio” in ATV11 AOSP

We are trying to implement “lottie-6.4.0.aar” library to ATV11 application to AOSP android. App complied successfully but when loading JSON animation file we get following animation. Same error getting in Android Studio also.

19:05:45.846 AndroidRuntime           D  Shutting down VM
19:05:45.851 AndroidRuntime           E  FATAL EXCEPTION: main
                                     Process: com.technicolor.tv.remotepairing, PID: 25850
                                     java.lang.IllegalStateException: Unable to parse composition
                                        at 
com.airbnb.lottie.LottieAnimationView.lambda$static$0(LottieAnimationView.java:74)
                                        at 
com.airbnb.lottie.-$$Lambda$LottieAnimationView$_QsjyhNZ7CpKRrGRN9Z59RcnTW8.onResult(Unknown Source:2)
                                        at com.airbnb.lottie.LottieAnimationView$WeakFailureListener.onResult(LottieAnimationView.java:116)
                                        at com.airbnb.lottie.LottieAnimationView$WeakFailureListener.onResult(LottieAnimationView.java:98)
                                        at com.airbnb.lottie.LottieTask.notifyFailureListeners(LottieTask.java:179)
                                        at com.airbnb.lottie.LottieTask.notifyListenersInternal(LottieTask.java:156)
                                        at com.airbnb.lottie.LottieTask.lambda$UEMe74LoiWimpRSllfPk_cTR81I(Unknown Source:0)
                                        at com.airbnb.lottie.-$$Lambda$LottieTask$UEMe74LoiWimpRSllfPk_cTR81I.run(Unknown Source:2)
                                        at android.os.Handler.handleCallback(Handler.java:938)
                                        at android.os.Handler.dispatchMessage(Handler.java:99)
                                        at android.os.Looper.loop(Looper.java:223)
                                        at android.app.ActivityThread.main(ActivityThread.java:7656)
                                        at java.lang.reflect.Method.invoke(Native Method)
                                        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:962)
                                     Caused by: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Failed resolution of: Lokio/Okio;
                                        at java.util.concurrent.FutureTask.report(FutureTask.java:123)
                                        at java.util.concurrent.FutureTask.get(FutureTask.java:193)
                                        at com.airbnb.lottie.LottieTask$LottieFutureTask.done(LottieTask.java:201)
                                        at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
                                        at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
                                        at java.util.concurrent.FutureTask.run(FutureTask.java:271)
                                        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
                                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
                                        at java.lang.Thread.run(Thread.java:923)
                                     Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lokio/Okio;
                                        at com.airbnb.lottie.LottieCompositionFactory.fromRawResSync(LottieCompositionFactory.java:304)
                                        at com.airbnb.lottie.LottieCompositionFactory.lambda$fromRawRes$2(LottieCompositionFactory.java:270)
                                        at com.airbnb.lottie.-$$Lambda$LottieCompositionFactory$kHreHcMxmvmikrk5-OrqBQ8jSUc.call(Unknown Source:8)
                                        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                                        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
                                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
                                        at java.lang.Thread.run(Thread.java:923) 
                                     Caused by: java.lang.ClassNotFoundException: okio.Okio
                                        at com.airbnb.lottie.LottieCompositionFactory.fromRawResSync(LottieCompositionFactory.java:304) 
                                        at com.airbnb.lottie.LottieCompositionFactory.lambda$fromRawRes$2(LottieCompositionFactory.java:270) 
                                        at com.airbnb.lottie.-$$Lambda$LottieCompositionFactory$kHreHcMxmvmikrk5-OrqBQ8jSUc.call(Unknown Source:8) 
                                        at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
                                        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
                                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
                                        at java.lang.Thread.run(Thread.java:923) 

In layout we add like below,

 <com.airbnb.lottie.LottieAnimationView
    android:id="@+id/lottieAnim1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:lottie_autoPlay="false"
    app:lottie_loop="true"
    app:lottie_rawRes="@raw/animation_sample_1"/>

Please help to solve this error.

After adding implementation ‘com.squareup.okio:okio:2.1.0’ dependencies the error is solved in Android Studio. We must add this dependencies ? if yes what is the solution for AOSP application (Android.mk).

My android mk file,

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE_TAGS  := optional
LOCAL_CERTIFICATE  := platform
LOCAL_SRC_FILES    := $(call all-subdir-java-files)
LOCAL_SRC_FILES += $(call all-Iaidl-files-under, src)
LOCAL_PACKAGE_NAME := LottieSample
LOCAL_PROGUARD_ENABLED := disabled
LOCAL_DEX_PREOPT := false
LOCAL_PRIVILEGED_MODULE := true
LOCAL_PRIVATE_PLATFORM_APIS := true

LOCAL_STATIC_JAVA_LIBRARIES := lottie_api

LOCAL_STATIC_ANDROID_LIBRARIES := 
     androidx.appcompat_appcompat 

include $(BUILD_PACKAGE)

include $(CLEAR_VARS)
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES :=lottie_api:libs/lottie-6.4.0.aar
include $(BUILD_MULTI_PREBUILT)

include $(call all-makefiles-under,$(LOCAL_PATH))

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật