Insta360Develop / CameraSDK-Android

Android SDK to control Insta360 cameras
81 stars 9 forks source link

Crash on inflating InstaCapturePlayerView due to deprecated android.arch.lifecycle #19

Open siju-s opened 2 years ago

siju-s commented 2 years ago

Crash on inflating preview

Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/arch/lifecycle/LifecycleObserver;

Cannot call setLifecycle method in activity as SDK uses deprecated android.arch.lifecycle instead of androidx.lifecycle.Lifecycle .

siju-s commented 2 years ago

Works fine on 1.3.10 which uses AndroidX but not on 1.3.15 which uses support library version.

yuanhawk commented 2 years ago

Hi @siju-s, I am facing the same issue, is there any workaround regarding this? On the newest release: 1.3.23, the InstaCapturePlayerView.class is still using the android.arch.lifecycle, and my project uses the androidx.lifecycle.Lifecycle

yuanhawk commented 2 years ago

Workaround add the following line into gradle.properties

android.enableJetifier=true

Hope that it helps anyone who ran into the same problem :-)