Crash When Showing Interstitial Ad in Jetpack Compose Due to Local Current Context Cast as Activity
I’m working on an Android app using Jetpack Compose and I’m trying to show an interstitial ad using InterstitialAd.show(context as Activty) inside a composable screen. However, I’m getting a crash when casting LocalContext.current to Activity in order to call the show() method for the ad. This crash started occurring after I updated the compileSdkVersion and targetSdkVersion to 35.