Instabug/Instabug-Android

ClassCastException: Activity cannot be cast to androidx.appcompat.app.AppCompatActivity

isles1217 opened this issue · 3 comments

Steps to Reproduce the Problem

  1. Launch an Activity that extends ComponentActivity (not AppCompatActivity)
  2. The app crashes

Expected Behavior

The app doesn't crash immediately

Actual Behavior

The app crashes immediately

Instabug integration code

N/A

SDK Version

12.5.0

Android Version

14

Device Model

Pixel 7a

Stacktrace:

java.lang.ClassCastException: com.example.app.SomeComponentActivity cannot be cast to androidx.appcompat.app.AppCompatActivity
	at com.instabug.library.tracking.InstabugInternalTrackingDelegate.handleActivityStartedEvent(SourceFile:23)
	at com.instabug.library.tracking.o.onActivityStarted(SourceFile:2)
	at android.app.Application.dispatchActivityStarted(Application.java:401)
	at android.app.Activity.dispatchActivityStarted(Activity.java:1462)
	at android.app.Activity.onStart(Activity.java:2001)
	at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1582)
	at android.app.Activity.performStart(Activity.java:8654)
	at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3827)
	at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:225)
	at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:205)
	at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:177)
	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:98)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2448)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:205)
	at android.os.Looper.loop(Looper.java:294)
	at android.app.ActivityThread.main(ActivityThread.java:8194)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)

I am having this issue too on 12.5.0 but not 12.4.1.

@isles1217 @wilburx9 Thanks for reporting this, we are now aware of the issue and already have a fix for it that will be released very soon. I'll get you back once the fix is released.

@isles1217 @wilburx9 The issue has been fixed in version 12.5.1. Please update the SDK version and check again.
I'll close this issue for now and please feel free to open it again if you still facing issues in this part 🙏🏻