"java.lang.String cannot be cast to java.lang.Object[]" multiple crashes

510 views
Skip to first unread message

in

unread,
Nov 12, 2024, 8:10:10 AM11/12/24
to Google Mobile Ads SDK Developers
Starting last few days, we get multiple crash report from google analytics related to "java.lang.String cannot be cast to java.lang.Object[]". (see several logs below).

No code change was made in last 2 months.

Currently this is seen on earlier Android OS devices (8.1, 8.1.0, 9, 10).

compileSdk 34. targetSdkVersion 34. minSdkVersion 23.

The crashes are reported from several different places, but they all end by "java.lang.String cannot be cast to java.lang.Object":

----------- crash no 1 -----------------------

          Fatal Exception: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Object[]
       at android.util.ArrayMap.allocArrays(ArrayMap.java:230)
       at android.util.ArrayMap.put(ArrayMap.java:558)
       at android.os.BaseBundle.putString(BaseBundle.java:671)
       at com.google.android.gms.ads.internal.client.zzg.zzf(com.google.android.gms:play-services-ads-lite@@22.0.0:1)
       at com.google.android.gms.ads.internal.client.zzbg.zzbE(com.google.android.gms:play-services-ads-lite@@22.0.0:4)
       at com.google.android.gms.internal.ads.zzasw.onTransact(com.google.android.gms:play-services-ads-base@@22.0.0:3)
       at android.os.Binder.transact(Binder.java:938)
       at m.anw.bh(:com.google.android.gms.policy_ads_fdr_dynamite@243799214@243799204017.685849251.685849251:8)
       at com.google.android.gms.ads.internal.client.ap.e(:com.google.android.gms.policy_ads_fdr_dynamite@243799214@243799204017.685849251.685849251:10)
       at com.google.android.gms.ads.nonagon.shim.l.a(:com.google.android.gms.policy_ads_fdr_dynamite@243799214@243799204017.685849251.685849251:5)
       at com.google.android.gms.ads.nonagon.slot.common.p.a(:com.google.android.gms.policy_ads_fdr_dynamite@243799214@243799204017.685849251.685849251:8)
       at com.google.android.gms.ads.nonagon.shim.z.bu(:com.google.android.gms.policy_ads_fdr_dynamite@243799214@243799204017.685849251.685849251:8)
       at com.google.android.gms.ads.nonagon.shim.listeners.a.bu(:com.google.android.gms.policy_ads_fdr_dynamite@243799214@243799204017.685849251.685849251:3)
       at com.google.android.gms.ads.nonagon.shim.loaders.f.run(:com.google.android.gms.policy_ads_fdr_dynamite@243799214@243799204017.685849251.685849251:11)
       at android.os.Handler.handleCallback(Handler.java:883)
       at android.os.Handler.dispatchMessage(Handler.java:100)
       at m.bby.a(:com.google.android.gms.policy_ads_fdr_dynamite@243799214@243799204017.685849251.685849251:1)
       at com.google.android.gms.ads.internal.util.f.a(:com.google.android.gms.policy_ads_fdr_dynamite@243799214@243799204017.685849251.685849251:1)
       at m.bby.dispatchMessage(:com.google.android.gms.policy_ads_fdr_dynamite@243799214@243799204017.685849251.685849251:1)
       at android.os.Looper.loop(Looper.java:214)
       at android.app.ActivityThread.main(ActivityThread.java:7692)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:503)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
       

----------- crash no 2 -----------------------

   Fatal Exception: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Object[]
       at android.util.ArrayMap.allocArrays(ArrayMap.java:230)
       at android.util.ArrayMap.put(ArrayMap.java:558)
       at android.widget.RelativeLayout$DependencyGraph.findRoots(RelativeLayout.java:2003)
       at android.widget.RelativeLayout$DependencyGraph.getSortedViews(RelativeLayout.java:1932)
       at android.widget.RelativeLayout.sortChildren(RelativeLayout.java:401)
       at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:409)
       at android.view.View.measure(View.java:26415)
       at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7845)
       at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
       at androidx.appcompat.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:141)
       at android.view.View.measure(View.java:26415)
       at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7845)
       at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552)
       at android.widget.LinearLayout.measureVertical(LinearLayout.java:842)
       at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
       at android.view.View.measure(View.java:26415)
       at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7845)
       at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
       at android.view.View.measure(View.java:26415)
       at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7845)
       at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552)
       at android.widget.LinearLayout.measureVertical(LinearLayout.java:842)
       at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
       at android.view.View.measure(View.java:26415)
       at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7845)
       at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
       at com.android.internal.policy.DecorView.onMeasure(DecorView.java:1010)
       at android.view.View.measure(View.java:26415)
       at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:3605)
       at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:2348)
       at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2640)
       at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2200)
       at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8999)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:996)
       at android.view.Choreographer.doCallbacks(Choreographer.java:794)
       at android.view.Choreographer.doFrame(Choreographer.java:729)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:981)
       at android.os.Handler.handleCallback(Handler.java:883)
       at android.os.Handler.dispatchMessage(Handler.java:100)
       at android.os.Looper.loop(Looper.java:237)
       at android.app.ActivityThread.main(ActivityThread.java:7860)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1075)

----------- crash no 3 -----------------------

 Caused by java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Object[]
       at android.util.ArrayMap.allocArrays(ArrayMap.java:230)
       at android.util.ArrayMap.put(ArrayMap.java:558)
       at android.animation.AnimatorSet.<init>(AnimatorSet.java:199)
       at android.animation.AnimatorInflater.createAnimatorFromXml(AnimatorInflater.java:671)
       at android.animation.AnimatorInflater.createAnimatorFromXml(AnimatorInflater.java:642)
       at android.animation.AnimatorInflater.createStateListAnimatorFromXml(AnimatorInflater.java:237)
       at android.animation.AnimatorInflater.loadStateListAnimator(AnimatorInflater.java:170)
       at android.view.View.<init>(View.java:5763)
       at android.widget.TextView.<init>(TextView.java:982)
       at android.widget.Button.<init>(Button.java:166)
       at android.widget.Button.<init>(Button.java:141)
       at androidx.appcompat.widget.AppCompatButton.<init>(AppCompatButton.java:81)
       at androidx.appcompat.widget.AppCompatButton.<init>(AppCompatButton.java:76)
       at androidx.appcompat.app.AppCompatViewInflater.createButton(AppCompatViewInflater.java:238)
       at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:156)
       at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1654)
       at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1705)
       at android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1061)
       at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:997)
       at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
       at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
       at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
       at android.view.LayoutInflater.rInflate(LayoutInflater.java:1126)
       at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
       at android.view.LayoutInflater.rInflate(LayoutInflater.java:1126)
       at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
       at android.view.LayoutInflater.rInflate(LayoutInflater.java:1126)
       at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
       at android.view.LayoutInflater.rInflate(LayoutInflater.java:1126)
       at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
       at android.view.LayoutInflater.inflate(LayoutInflater.java:682)
       at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
       at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
       at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:7747)
       at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:7847)
       at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:6646)
       at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6917)
       at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6757)
       at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6753)
       at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2362)
       at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1662)
       at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1622)
       at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:687)
       at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4645)
       at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:4348)
       at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4919)
       at android.view.View.layout(View.java:22676)
       at android.view.ViewGroup.layout(ViewGroup.java:6334)
       at androidx.coordinatorlayout.widget.CoordinatorLayout.layoutChild(CoordinatorLayout.java:1213)
       at androidx.coordinatorlayout.widget.CoordinatorLayout.onLayoutChild(CoordinatorLayout.java:899)
       at androidx.coordinatorlayout.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:919)
       at android.view.View.layout(View.java:22676)
       at android.view.ViewGroup.layout(ViewGroup.java:6334)
       at androidx.viewpager.widget.ViewPager.onLayout(ViewPager.java:1775)
       at android.view.View.layout(View.java:22676)
       at android.view.ViewGroup.layout(ViewGroup.java:6334)
       at com.google.android.material.appbar.HeaderScrollingViewBehavior.layoutChild(HeaderScrollingViewBehavior.java:149)
       at com.google.android.material.appbar.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:43)
       at com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior.onLayoutChild(AppBarLayout.java:2365)
       at androidx.coordinatorlayout.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:918)
       at android.view.View.layout(View.java:22676)
       at android.view.ViewGroup.layout(ViewGroup.java:6334)
       at androidx.drawerlayout.widget.DrawerLayout.onLayout(DrawerLayout.java:1263)
       at android.view.View.layout(View.java:22676)
       at android.view.ViewGroup.layout(ViewGroup.java:6334)
       at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
       at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
       at android.view.View.layout(View.java:22676)
       at android.view.ViewGroup.layout(ViewGroup.java:6334)
       at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
       at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
       at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
       at android.view.View.layout(View.java:22676)
       at android.view.ViewGroup.layout(ViewGroup.java:6334)
       at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
       at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
       at android.view.View.layout(View.java:22676)
       at android.view.ViewGroup.layout(ViewGroup.java:6334)
       at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
       at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
       at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
       at android.view.View.layout(View.java:22676)
       at android.view.ViewGroup.layout(ViewGroup.java:6334)
       at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
       at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
       at com.android.internal.policy.DecorView.onLayout(DecorView.java:786)
       at android.view.View.layout(View.java:22676)
       at android.view.ViewGroup.layout(ViewGroup.java:6334)
       at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:3431)
       at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2855)
       at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1975)
       at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8249)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1239)
       at android.view.Choreographer.doCallbacks(Choreographer.java:1041)
       at android.view.Choreographer.doFrame(Choreographer.java:953)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1220)
       at android.os.Handler.handleCallback(Handler.java:883)
       at android.os.Handler.dispatchMessage(Handler.java:100)
       at android.os.Looper.loop(Looper.java:214)
       at android.app.ActivityThread.main(ActivityThread.java:7711)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)


----------- crash no 4 -----------------------


 Fatal Exception: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Object[]
       at android.util.ArrayMap.allocArrays(ArrayMap.java:213)
       at android.util.ArrayMap.put(ArrayMap.java:499)
       at android.os.BaseBundle.putCharSequence(BaseBundle.java:678)
       at android.os.Bundle.putCharSequence(Bundle.java:490)
       at android.support.v4.media.MediaMetadataCompat$Builder.putString(MediaMetadataCompat.java:775)
       at androidx.media3.exoplayer.ExoPlayerImpl.lambda$updatePlaybackInfo$21(ExoPlayerImpl.java:2152)
       at androidx.media3.exoplayer.ExoPlayerImpl$$ExternalSyntheticLambda14.invoke(:4)
       at androidx.media3.common.util.ListenerSet$ListenerHolder.invoke(ListenerSet.java:339)
       at androidx.media3.common.util.ListenerSet.lambda$queueEvent$0(ListenerSet.java:223)
       at androidx.media3.common.util.ListenerSet$$ExternalSyntheticLambda1.run(:6)
       at androidx.media3.common.util.ListenerSet.flushEvents(ListenerSet.java:245)
       at androidx.media3.exoplayer.ExoPlayerImpl.updatePlaybackInfo(ExoPlayerImpl.java:2182)
       at androidx.media3.exoplayer.ExoPlayerImpl.prepare(ExoPlayerImpl.java:567)
       at android.view.View.performClick(View.java:6608)
       at android.view.View.performClickInternal(View.java:6585)
       at android.view.View.access$3100(View.java:778)
       at android.view.View$PerformClick.run(View.java:25944)
       at android.os.Handler.handleCallback(Handler.java:873)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:193)
       at android.app.ActivityThread.main(ActivityThread.java:6865)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:504)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Mobile Ads SDK Forum Advisor

unread,
Nov 12, 2024, 12:20:45 PM11/12/24
to inma...@gmail.com, google-adm...@googlegroups.com

Hi,

Could you please attempt to run our Google sample project and confirm the results? Kindly provide us with the below information for further investigation privately:

  • app ID
  • ad unit ID
  • Mobile Ads SDK Version
  • Sample project reproducing the issue

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, kindly provide requested information to us via reply to author option or using the steps below:

1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=5004Q00002vGjMsQAK&entry.80707362=00275192

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.

 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vGjMs:ref" (ADR-00275192)

Thanks,
 
Google Logo Mobile Ads SDK Team

 

Mobile Ads SDK Forum Advisor

unread,
Nov 13, 2024, 8:49:18 AM11/13/24
to inma...@gmail.com, google-adm...@googlegroups.com

Hi,

We ran the Google sample project using your app ID, ad unit ID, and Mobile Ads SDK version 23.3.0, but we were unable to reproduce the crash. Could you try running our Google sample project on your end to see if you can replicate the issue and share the results with us?

We also recommend keeping your SDKs up to date, and the latest version as of today is 23.5.0. Please refer to the Google Mobile Ads SDK release notes for further details.

If the issue still persists, kindly provide us with the below information for further investigation privately:

  • Devices affected 
  • Steps to replicate the issue
  • Sample project which replicates the issue

Mobile Ads SDK Forum Advisor

unread,
Nov 18, 2024, 5:25:19 PM11/18/24
to inma...@gmail.com, google-adm...@googlegroups.com

Hi,

Thank you for getting back to us.

The Android Engineering team's most recent update states: "Newer platform versions may experience fewer crashes related to casting. This is due to earlier detection of the issue, which results in a ConcurrentModificationException."

This message is in relation to case "ref:!00D1U01174p.!5004Q02vGjMs:ref" (ADR-00275192)

Thanks,
 
Google Logo Mobile Ads SDK Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5



min...@gmail.com

unread,
Nov 24, 2024, 11:50:36 PM11/24/24
to Google Mobile Ads SDK Developers
Is there any news on when this will be fixed?
We still get 100s and thousands of crashes related to "cannot be cast to java.lang.Object[]"

Mobile Ads SDK Forum Advisor

unread,
Nov 25, 2024, 3:35:43 AM11/25/24
to min...@gmail.com, google-adm...@googlegroups.com

Hi,

The issue is still under investigation. Once we receive any updates, we will intimate you. Meanwhile, your patience is important.

min...@gmail.com

unread,
Dec 5, 2024, 1:00:59 PM12/5/24
to Google Mobile Ads SDK Developers
Hi again,
Any updates?
it's been a long time and our apps still get thousands of crashes because of this issue every day.  

Mobile Ads SDK Forum Advisor

unread,
Dec 5, 2024, 3:57:22 PM12/5/24
to min...@gmail.com, google-adm...@googlegroups.com

Hi,

The issue is still under investigation. We will inform you once we have an update.

min...@gmail.com

unread,
Feb 11, 2025, 6:35:45 AMFeb 11
to Google Mobile Ads SDK Developers
Hello,
It's been almost 5 months. Our apps still gets a thousands of crashes daily. Is it ever going to be fixed or it's time to consider moving away from AdMob?

Mobile Ads SDK Forum Advisor

unread,
Feb 11, 2025, 11:40:37 AMFeb 11
to min...@gmail.com, google-adm...@googlegroups.com

Hi,

Thank you for getting back to us.

Currently there is no update at this time. Once we receive any updates, we will intimate you. Meanwhile, your patience is important. 

Maciej S

unread,
May 26, 2025, 3:35:48 AMMay 26
to Google Mobile Ads SDK Developers
Hi,

we're currently observing the same problem crash for users with Android 8,9 and 10.

"The Android Engineering team's most recent update states: "Newer platform versions may experience fewer crashes related to casting. This is due to earlier detection of the issue, which results in a ConcurrentModificationException.""

Does that mean that both exceptions are manifestations of the same underlying issue? We've observed a lot of 'ConcurrentModificationException' crashes coming from the SDK too. See https://groups.google.com/g/google-admob-ads-sdk/c/lLLAL7cYLAs/m/BCqoY2RMAQAJ for reference. Both are critical issues for us, the crashes made us roll back the AdMob native ads integration completely until we figure this out.
The contents of this message and any attachments are for use by the addressee named in this message and contains information that may be privileged, confidential or copyrighted under applicable law. If you are not the intended recipient or if this message has been addressed to you in error, please immediately alert the sender by reply e-mail and then delete this message and any attachments. Any disclosure, copying, distribution or taking action in relation of the contents of this message is strictly prohibited and may be unlawful. Thank you for your cooperation.
Reply all
Reply to author
Forward
0 new messages