I have recently noticed a lot of these crashes in my app. I am not able to reproduce it myself.
Any idea what the issue might be? I think it might happen when a bottom sheet dialog is about to be shown.
For reference my app supports 3 languages (English, Spanish and Bulgarian)
Exception java.lang.IllegalArgumentException: list[1] is a repetition
at android.os.LocaleList.<init> (LocaleList.java:193)
at androidx.appcompat.app.LocaleOverlayHelper.combineLocales (LocaleOverlayHelper.java:73)
at androidx.appcompat.app.LocaleOverlayHelper.combineLocalesIfOverlayExists (LocaleOverlayHelper.java:47)
at androidx.appcompat.app.AppCompatDelegateImpl.calculateApplicationLocales (AppCompatDelegateImpl.java:2470)
at androidx.appcompat.app.AppCompatDelegateImpl.applyApplicationSpecificConfig (AppCompatDelegateImpl.java:2426)
at androidx.appcompat.app.AppCompatDelegateImpl.onCreate (AppCompatDelegateImpl.java:514)
at androidx.appcompat.app.AppCompatDialog.<init> (AppCompatDialog.java:65)
at com.google.android.material.bottomsheet.BottomSheetDialog.<init> (BottomSheetDialog.java:95)
at com.google.android.material.bottomsheet.BottomSheetDialogFragment.onCreateDialog (BottomSheetDialogFragment.java:50)
at androidx.fragment.app.DialogFragment.prepareDialog (DialogFragment.java:648)
at androidx.fragment.app.DialogFragment.onGetLayoutInflater (DialogFragment.java:562)
at androidx.fragment.app.Fragment.performGetLayoutInflater (Fragment.java:1725)
at androidx.fragment.app.FragmentStateManager.createView (FragmentStateManager.java:492)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState (FragmentStateManager.java:261)
at androidx.fragment.app.FragmentManager.executeOpsTogether (FragmentManager.java:1862)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute (FragmentManager.java:1786)
at androidx.fragment.app.FragmentManager.execPendingActions (FragmentManager.java:1723)
at androidx.fragment.app.FragmentManager$4.run (FragmentManager.java:510)
at android.os.Handler.handleCallback (Handler.java:873)
at android.os.Handler.dispatchMessage (Handler.java:99)
at androidx.test.espresso.base.Interrogator.loopAndInterrogate (Interrogator.java:10)
at androidx.test.espresso.base.UiControllerImpl.loopUntil (UiControllerImpl.java:7)
at androidx.test.espresso.base.UiControllerImpl.loopUntil (UiControllerImpl.java:1)
at androidx.test.espresso.base.UiControllerImpl.injectMotionEvent (UiControllerImpl.java:5)
at androidx.test.espresso.action.MotionEvents.sendUp (MotionEvents.java:6)
at androidx.test.espresso.action.MotionEvents.sendUp (MotionEvents.java:1)
at androidx.test.espresso.action.Tap.sendSingleTap (Tap.java:5)
at androidx.test.espresso.action.Tap.-$$Nest$smsendSingleTap (Tap.java)
at androidx.test.espresso.action.Tap$1.sendTap (Tap.java:1)
at androidx.test.espresso.action.GeneralClickAction.perform (GeneralClickAction.java:4)
at androidx.test.espresso.ViewInteraction$SingleExecutionViewAction.perform (ViewInteraction.java:2)
at androidx.test.espresso.ViewInteraction.doPerform (ViewInteraction.java:21)
at androidx.test.espresso.ViewInteraction.-$$Nest$mdoPerform (ViewInteraction.java)
at androidx.test.espresso.ViewInteraction$1.call (ViewInteraction.java:6)
at androidx.test.espresso.ViewInteraction$1.call (ViewInteraction.java:1)
at java.util.concurrent.FutureTask.run (FutureTask.java:266)
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:6846)
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:883)
CodePudding user response:
Fixed by updating to androidx.appcompat:appcompat:1.6.0-alpha04
.
I was using androidx.appcompat:appcompat:1.6.0-alpha01
, and according to this issue, versions below 1.6.0-alpha02 causes a crash when setting a locale from app that is part of the system languages.