RuntimeException android.os.TransactionTooLargeException

У меня произошел сбой в приложении, и я не знаю, как исправить. Вот трассировка стека:

      RuntimeException
android.os.TransactionTooLargeException: data parcel size 527140 bytes

android.app.ActivityClient in activityStopped at line 88
System
android.app.servertransaction.PendingTransactionActions$StopInfo in run at line 143
System
android.os.Handler in handleCallback at line 942
System
android.os.Handler in dispatchMessage at line 99
System
android.os.Looper in loopOnce at line 226
System
android.os.Looper in loop at line 313
System
android.app.ActivityThread in main at line 8757
System
java.lang.reflect.Method in invoke
System
com.android.internal.os.RuntimeInit$MethodAndArgsCaller in run at line 571
System
com.android.internal.os.ZygoteInit in main at line 1067
System
TransactionTooLargeException
data parcel size 527140 bytes

android.os.BinderProxy in transactNative
System
android.os.BinderProxy in transact at line 662
System
android.app.IActivityClientController$Stub$Proxy in activityStopped at line 1309
System
android.app.ActivityClient in activityStopped at line 85
System
android.app.servertransaction.PendingTransactionActions$StopInfo in run at line 143
System
android.os.Handler in handleCallback at line 942
System
android.os.Handler in dispatchMessage at line 99
System
android.os.Looper in loopOnce at line 226
System
android.os.Looper in loop at line 313
System
android.app.ActivityThread in main at line 8757
System
java.lang.reflect.Method in invoke
System
com.android.internal.os.RuntimeInit$MethodAndArgsCaller in run at line 571
System
com.android.internal.os.ZygoteInit in main at line 1067

Это начало происходить, когда я преобразовал наше приложение в приложение с панелью вкладок, используя фрагмент навигационного хоста с помощью mobile_navigation.xml.

Вот xml для основного действия:

      <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools">
    <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/container"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <View
            android:id="@+id/black_bottom_view"
            android:layout_width="match_parent"
            android:layout_height="@dimen/tab_bar_height"
            android:background="@color/black"
            android:visibility="visible"
            app:layout_constraintBottom_toBottomOf="parent" />

        <androidx.constraintlayout.widget.Group
            android:id="@+id/tab_bar_group"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:constraint_referenced_ids="black_bottom_view,nav_view" />

        <com.google.android.material.bottomnavigation.BottomNavigationView
            android:id="@+id/nav_view"
            android:layout_width="0dp"
            android:layout_height="80dp"
            android:layout_marginStart="0dp"
            android:layout_marginEnd="0dp"
            android:background="@color/transparent"
            android:visibility="visible"
            app:itemIconSize="80dp"
            app:itemIconTint="@color/nav_menu_item_color"
            app:labelVisibilityMode="unlabeled"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="@id/black_bottom_view"
            app:menu="@menu/bottom_nav_menu" />

        <fragment
            android:id="@+id/nav_host_fragment"
            android:name="androidx.navigation.fragment.NavHostFragment"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            app:defaultNavHost="true"
            app:layout_constraintBottom_toTopOf="@id/nav_view"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:navGraph="@navigation/mobile_navigation" />


    </androidx.constraintlayout.widget.ConstraintLayout>
</layout>

Вот mobile_navigation.xml

      <?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/mobile_navigation"
    app:startDestination="@+id/navigation_home">

    <fragment
        android:id="@+id/navigation_home"
        android:name="com.mApp.home.HomeFragment"
        android:label="@string/tab_bar_label_home"
        tools:layout="@layout/fragment_home" >
        <action
            android:id="@+id/action_navigation_home_to_navigation_c"
            app:destination="@id/navigation_c"
              />
        <action
            android:id="@+id/action_navigation_home_to_navigation_v_i"
            app:destination="@id/navigation_v_i"
              />
        <action
            android:id="@+id/action_navigation_home_to_navigation_view_profile"
            app:destination="@id/navigation_view_profile"
              />
        <action
            android:id="@+id/action_navigation_home_to_navigation_preferences"
            app:destination="@id/navigation_preferences"

            />
        <action
            android:id="@+id/action_navigation_home_to_navigation_personal_info"
            app:destination="@id/navigation_personal_info"
              />
        <action
            android:id="@+id/action_navigation_home_to_navigation_i_m"
            app:destination="@id/navigation_i_m"
            app:enterAnim="@anim/bottom_to_top"
            app:exitAnim="@anim/stay"
            app:popEnterAnim="@anim/bottom_to_top"
            app:popExitAnim="@anim/stay" />
        <action
            android:id="@+id/action_navigation_home_to_navigation_media_preview"
            app:destination="@id/navigation_media_preview"
             />
        <action
            android:id="@+id/action_navigation_home_to_navigation_notifications"
            app:destination="@id/navigation_notifications"
              />
    </fragment>

    <fragment
        android:id="@+id/navigation_swlm"
        android:name="com.mApp.swlm.SWLMFragment">
        <action
            android:id="@+id/action_navigation_swlm_to_navigation_mup_settings"
            app:destination="@id/navigation_mup_settings"
              />
        <action
            android:id="@+id/action_navigation_swlm_to_navigation_personal_info"
            app:destination="@id/navigation_personal_info"
              />
    </fragment>

    <fragment
        android:id="@+id/navigation_c"
        android:name="com.mApp.c.cList.CListFragment">
        <action
            android:id="@+id/action_navigation_c_list_to_navigation_single_c"
            app:destination="@id/navigation_single_c"

            />
        <action
            android:id="@+id/action_navigation_c_list_to_navigation_swlm"
            app:destination="@id/navigation_swlm"
            />
        <argument
            android:name="mProfile"
            app:argType="com.mApp.dataobjects.MProfile"
            app:nullable="true"
            android:defaultValue="@null" />
        <action
            android:id="@+id/action_navigation_c_list_to_navigation_archive"
            app:destination="@id/navigation_archive"

            />
        <action
            android:id="@+id/action_navigation_c_list_to_navigation_home"
            app:destination="@id/navigation_home"
            
            />
        <argument
            android:name="isNewM"
            app:argType="boolean"
            android:defaultValue="false" />
    </fragment>

    <fragment
        android:id="@+id/navigation_archive"
        android:name="com.mApp.c.archive.ArchiveFragment"
        tools:layout="@layout/fragment_archive" >
        <action
            android:id="@+id/action_navigation_archive_to_navigation_single_c"
            app:destination="@id/navigation_single_c"

            />
    </fragment>

    <fragment
        android:id="@+id/navigation_single_c"
        android:name="com.mApp.c.CFragment"
        >
        <argument
            android:name="mProfile"
            app:argType="com.mApp.dataobjects.MProfile" />
        <argument
            android:name="callId"
            app:argType="long"
            android:defaultValue="0L" />
        <action
            android:id="@+id/action_navigation_single_c_to_navigation_d"
            app:destination="@id/navigation_d"
             />
        <argument
            android:name="shouldShowTabBarOnBack"
            app:argType="boolean"
            android:defaultValue="true" />
        <argument
            android:name="isFromArchiveScreen"
            app:argType="boolean"
            android:defaultValue="false" />
        <action
            android:id="@+id/action_navigation_single_c_to_navigation_view_profile"
            app:destination="@id/navigation_view_profile"
              />
        <argument
            android:name="isNewM"
            app:argType="boolean"
            android:defaultValue="false" />
        <argument
            android:name="isFromIM"
            app:argType="boolean"
            android:defaultValue="false" />
        <action
            android:id="@+id/action_navigation_single_c_to_navigation_d_full_detail"
            app:destination="@id/navigation_d_full_detail"
              />
    </fragment>

    <fragment
        android:id="@+id/navigation_d"
        android:name="com.mApp.d.dssdk.experiences.browse.main.DMainFragment">
        <action
            android:id="@+id/action_navigation_d_to_navigation_d_category"
            app:destination="@id/navigation_d_category"
            
            />
        <argument
            android:name="mUserId"
            app:argType="string"
            app:nullable="true"
            android:defaultValue="@null" />
        <argument
            android:name="mId"
            app:argType="string"
            app:nullable="true"
            android:defaultValue="@null" />
        <argument
            android:name="mName"
            app:argType="string"
            app:nullable="true"
            android:defaultValue="@null" />
        <argument
            android:name="mPhotoUrl"
            app:argType="string"
            app:nullable="true"
            android:defaultValue="@null" />
        <argument
            android:name="mProfile"
            app:argType="com.mApp.dataobjects.MProfile"
            app:nullable="true"
            android:defaultValue="@null" />
        <action
            android:id="@+id/action_navigation_d_to_navigation_d_filtered"
            app:destination="@id/navigation_d_filtered"
            
            />
        <action
            android:id="@+id/action_navigation_d_to_navigation_c"
            app:destination="@id/navigation_chat"
            
            />
        <argument
            android:name="categoryId"
            app:argType="string"
            app:nullable="true"
            android:defaultValue="@null"
            />
        <action
            android:id="@+id/action_navigation_d_to_navigation_d_full_detail"
            app:destination="@id/navigation_d_full_detail"
              />
    </fragment>

    <fragment
        android:id="@+id/navigation_media_preview"
        android:name="com.mApp.mediaPreview.MediaPreviewFragment"
        android:label="Media Preview">
        <argument
            android:name="url"
            app:argType="string" />
        <argument
            android:name="isIMedia"
            app:argType="boolean" />
    </fragment>

    <fragment
        android:id="@+id/navigation_account"
        android:name="com.mApp.account.AccountFragment"
        >
        <argument
            android:name="settingsAction"
            android:defaultValue="NONE"
            app:argType="com.mApp.account.SettingsAction" />
        <action
            android:id="@+id/action_navigation_main_menu_to_navigation_preferences"
            app:destination="@id/navigation_preferences"

            />
        <action
            android:id="@+id/action_navigation_main_menu_to_navigation_settings"
            app:destination="@id/navigation_settings"

            />
        <action
            android:id="@+id/action_navigation_main_menu_to_navigation_mup_settings"
            app:destination="@id/navigation_mup_settings"
              />
        <action
            android:id="@+id/action_navigation_main_menu_to_navigation_v_i"
            app:destination="@id/navigation_v_i"
              />
        <action
            android:id="@+id/action_navigation_account_to_navigation_view_profile"
            app:destination="@id/navigation_view_profile"
              />
        <action
            android:id="@+id/action_navigation_account_to_navigation_debug_menu"
            app:destination="@id/navigation_debug_menu"
              />
    </fragment>

    <fragment
        android:id="@+id/navigation_settings"
        android:name="com.mApp.settings.SettingsFragment"
        android:label="@string/settings.settings_title"
        tools:layout="@layout/fragment_settings" >
        <action
            android:id="@+id/action_navigation_account_to_navigation_preferences"
            app:destination="@id/navigation_preferences"
            
            />
        <action
            android:id="@+id/action_navigation_account_to_navigation_notification_settings"
            app:destination="@id/navigation_notification_settings"
              />
        <action
            android:id="@+id/action_navigation_account_to_navigation_mup_settings"
            app:destination="@id/navigation_mup_settings"
              />
    </fragment>

    <fragment
        android:id="@+id/navigation_notification_settings"
        android:name="com.mApp.notificationSettings.NotificationSettingsFragment"
        android:label="@string/tab_bar_label_notification_settings">
    </fragment>

    <fragment
        android:id="@+id/navigation_mup_settings"
        android:name="com.mApp.mupSettings.MUPSettingsFragment">
        <action
            android:id="@+id/action_navigation_mup_settings_to_navigation_swlm"
            app:destination="@id/navigation_swlm"
             />
        <argument
            android:name="showNPaywall"
            app:argType="boolean"
            android:defaultValue="false" />
        <argument
            android:name="showBPaywall"
            app:argType="boolean"
            android:defaultValue="false" />
        <action
            android:id="@+id/action_navigation_mup_settings_to_navigation_w"
            app:destination="@id/navigation_w"
              />
        <action
            android:id="@+id/action_navigation_mup_settings_to_navigation_promo_events"
            app:destination="@id/navigation_promo_events"
              />
        <action
            android:id="@+id/action_navigation_mup_settings_to_navigation_preferences"
            app:destination="@id/navigation_preferences"
            app:enterAnim="@anim/screen_pop_enter"
            app:exitAnim="@anim/screen_pop_exit"
            app:popEnterAnim="@anim/screen_pop_enter"
            app:popExitAnim="@anim/screen_pop_exit" />
        <action
            android:id="@+id/action_navigation_mup_settings_to_navigation_settings"
            app:destination="@id/navigation_settings"
            app:enterAnim="@anim/screen_pop_enter"
            app:exitAnim="@anim/screen_pop_exit"
            app:popEnterAnim="@anim/screen_pop_enter"
            app:popExitAnim="@anim/screen_pop_exit" />
        <argument
            android:name="openPromoCode"
            app:argType="boolean"
            android:defaultValue="false" />
        <argument
            android:name="promoCode"
            app:argType="string"
            app:nullable="true"
            android:defaultValue="@null" />
    </fragment>

    <fragment
        android:id="@+id/navigation_edit_profile_home"
        android:name="com.mApp.editVersion3.home.EditProfileHomeFragment"
        android:label="Edit Profile Home">
        <action
            android:id="@+id/action_navigation_edit_profile_home_to_navigation_a_y"
            app:destination="@id/navigation_a_y"
              />
        <action
            android:id="@+id/action_navigation_edit_profile_home_to_navigation_interests"
            app:destination="@id/navigation_interests"
              />
        <action
            android:id="@+id/action_navigation_edit_profile_home_to_navigation_personal_info"
            app:destination="@id/navigation_personal_info"
             />
        <action
            android:id="@+id/action_navigation_edit_profile_home_to_navigation_upload_photo"
            app:destination="@id/navigation_upload_photo"
              />
        <action
            android:id="@+id/action_navigation_edit_profile_home_to_navigation_v_i"
            app:destination="@id/navigation_v_i"
              />
        <action
            android:id="@+id/action_navigation_edit_profile_home_to_navigation_view_profile"
            app:destination="@id/navigation_view_profile"
              />
    </fragment>

    <fragment
        android:id="@+id/navigation_personal_info"
        android:name="com.mApp.editVersion3.personalInformation.PersonalInfoFragment"
        android:label="Personal Info"
        tools:layout="@layout/fragment_personal_info" >
        <action
            android:id="@+id/action_navigation_personal_info_to_navigation_view_profile"
            app:destination="@id/navigation_view_profile"
             />
        <argument
            android:name="shouldShowTabBarOnClose"
            app:argType="boolean"
            android:defaultValue="false" />
    </fragment>

    <fragment
        android:id="@+id/navigation_d_account"
        android:name="com.mApp.d.dssdk.experiences.purchased.account.ExperienceAccountFragment"
        >
        <argument
            android:name="dPurchased"
            app:argType="boolean"
            android:defaultValue="false" />
        <action
            android:id="@+id/action_navigation_d_account_to_navigation_d_settings"
            app:destination="@id/navigation_d_settings"
              />
        <action
            android:id="@+id/action_navigation_d_account_to_navigation_d_notifications"
            app:destination="@id/navigation_d_notifications"
              />
        <action
            android:id="@+id/action_navigation_d_account_to_navigation_d_full_detail"
            app:destination="@id/navigation_d_full_detail"
              />
    </fragment>

    <fragment
        android:id="@+id/navigation_crop_image"
        android:name="com.mApp.edit.photo.CropImageFragment"
        android:label="Crop Image"
        tools:layout="@layout/activity_crop_image" >
        <argument
            android:name="source"
            app:argType="string" />
        <argument
            android:name="photoId"
            app:argType="string" />
        <argument
            android:name="isFromImagesGrid"
            app:argType="boolean"
            android:defaultValue="false" />
    </fragment>

    <fragment
        android:id="@+id/navigation_upload_photo"
        android:name="com.mApp.editVersion3.uploadPhoto.UploadPhotoFragment"
        android:label="Upload Photo"
        tools:layout="@layout/fragment_photo_upload" >
        <action
            android:id="@+id/action_navigation_upload_photo_to_navigation_crop_image"
            app:destination="@id/navigation_crop_image"
              />
        <action
            android:id="@+id/action_navigation_upload_photo_to_navigation_album_list"
            app:destination="@id/navigation_album_list"

            />
        <action
            android:id="@+id/action_navigation_upload_photo_to_navigation_images_grid"
            app:destination="@id/navigation_images_grid"

            />
    </fragment>

    <fragment
        android:id="@+id/navigation_album_list"
        android:name="com.mApp.edit.photo.AlbumListFragment"
        android:label="Album List"
        tools:layout="@layout/activity_album_list" >
        <action
            android:id="@+id/action_navigation_album_list_to_navigation_images_grid"
            app:destination="@id/navigation_images_grid"
              />
        <argument
            android:name="isPromptPhoto"
            app:argType="boolean" />
    </fragment>

    <fragment
        android:id="@+id/navigation_images_grid"
        android:name="com.mApp.edit.photo.ImagesGridFragment"
        android:label="Images Grid"
        tools:layout="@layout/activity_images_grid" >
        <argument
            android:name="source"
            app:argType="string" />
        <argument
            android:name="albumId"
            app:argType="long" />
        <argument
            android:name="isPromptPhoto"
            app:argType="boolean" />
        <action
            android:id="@+id/action_navigation_images_grid_to_navigation_crop_image"
            app:destination="@id/navigation_crop_image"
              />
        <argument
            android:name="isFromAlbumList"
            app:argType="boolean"
            android:defaultValue="false" />
    </fragment>

    <fragment
        android:id="@+id/navigation_a_y"
        android:name="com.mApp.editVersion3.aY.AYFragment"
        >
        <action
            android:id="@+id/action_navigation_a_y_to_navigation_images_grid"
            app:destination="@id/navigation_images_grid"

            />
        <action
            android:id="@+id/action_navigation_a_y_to_navigation_album_list"
            app:destination="@id/navigation_album_list"

            />
    </fragment>

    <fragment
        android:id="@+id/navigation_i_m"
        android:name="com.mApp.im.IMFragment"
        >
        <argument
            android:name="isATeaser"
            app:argType="boolean"
            android:defaultValue="false" />
        <argument
            android:name="mComment"
            app:argType="com.mApp.dataobjects.Comment"
            app:nullable="true"
            android:defaultValue="@null" />
        <argument
            android:name="tComment"
            app:argType="com.mApp.dataobjects.Comment"
            app:nullable="true"
            android:defaultValue="@null" />
        <argument
            android:name="mProfile"
            app:argType="com.mApp.dataobjects.MProfile" />
    </fragment>

    <fragment
        android:id="@+id/navigation_interests"
        android:name="com.mApp.editVersion3.interests.InterestsFragment"
        android:label="Interests"
        tools:layout="@layout/fragment_interests" />

    <fragment
        android:id="@+id/navigation_w"
        android:name="com.mApp.w.WFragment"
         />

    <fragment
        android:id="@+id/navigation_debug_menu"
        android:name="com.mApp.debugMenu.DebugMenuFragment"
        android:label="Debug Menu"
        tools:layout="@layout/activity_debug_menu" >
        <action
            android:id="@+id/action_navigation_debug_menu_to_navigation_v_i"
            app:destination="@id/navigation_v_i" />
        <action
            android:id="@+id/action_navigation_debug_menu_to_navigation_view_profile"
            app:destination="@id/navigation_view_profile"
              />
    </fragment>

    <fragment
        android:id="@+id/navigation_view_profile"
        android:name="com.mApp.viewProfile.ViewProfileFragment"
        android:label="View Profile"
        tools:layout="@layout/activity_view_profile" >
        <argument
            android:name="userId"
            app:argType="string" />
        <argument
            android:name="isLoggedInUser"
            app:argType="boolean" />
        <argument
            android:name="isSG"
            app:argType="boolean" />
        <action
            android:id="@+id/action_navigation_view_profile_to_navigation_personal_info"
            app:destination="@id/navigation_personal_info"
              />
        <action
            android:id="@+id/action_navigation_view_profile_to_navigation_media_preview"
            app:destination="@id/navigation_media_preview"
              />
        <argument
            android:name="shouldShowTabBarOnClose"
            app:argType="boolean"
            android:defaultValue="false" />
        <argument
            android:name="shouldSetStatusBarDarkOnClose"
            app:argType="boolean"
            android:defaultValue="false" />
    </fragment>

    <fragment
        android:id="@+id/navigation_v_i"
        android:name="com.mApp.editVersion3.vI.VIFragment"
        >
        <argument
            android:name="isNewUser"
            app:argType="boolean"
            android:defaultValue="false" />
        <argument
            android:name="isFromDebugMenu"
            app:argType="boolean"
            android:defaultValue="false" />
        <argument
            android:name="shouldShowTabBarOnClose"
            app:argType="boolean"
            android:defaultValue="false" />
    </fragment>

    <fragment
        android:id="@+id/navigation_promo_events"
        android:name="com.mApp.promoEvents.PromoEventsFragment"
        android:label="Promo Events"
        tools:layout="@layout/activity_promo_events" >
        <argument
            android:name="photoUrl"
            app:argType="string"
            app:nullable="true"
            android:defaultValue="@null" />
        <argument
            android:name="firstName"
            app:argType="string"
            app:nullable="true"
            android:defaultValue="@null" />
        <argument
            android:name="promoCode"
            app:argType="string"
            app:nullable="true"
            android:defaultValue="@null" />
    </fragment>

    <action
        android:id="@+id/action_global_navigation_v_i"
        app:destination="@id/navigation_v_i"
         />

    <action
        android:id="@+id/action_global_navigation_edit_profile_home"
        app:destination="@id/navigation_edit_profile_home"
          />

    <action
        android:id="@+id/action_global_navigation_home"
        app:destination="@id/navigation_home"
        
        />

    <action
        android:id="@+id/action_global_navigation_swlm"
        app:destination="@id/navigation_swlm"
        
        />

    <action
        android:id="@+id/action_global_navigation_c"
        app:destination="@id/navigation_c"
        
        />

    <action
        android:id="@+id/action_global_navigation_d"
        app:destination="@id/navigation_d"
        
        />

    <action
        android:id="@+id/action_global_navigation_settings"
        app:destination="@id/navigation_account"
        
        />
    <action
        android:id="@+id/action_global_navigation_mup_settings"
        app:destination="@id/navigation_mup_settings"
        
        />
    <action
        android:id="@+id/action_global_navigation_personal_info"
        app:destination="@id/navigation_personal_info"
         />
    <action
        android:id="@+id/action_global_navigation_d_account"
        app:destination="@id/navigation_d_account"
          />
    <action
        android:id="@+id/action_global_navigation_view_profile"
        app:destination="@id/navigation_view_profile"
        />
</navigation>

Я уже пытался это исправить, добавив этот код ко всем моим фрагментам и действиям, но это не помогло:

      override fun onSaveInstanceState(outState: Bundle) {
        outState.clear()
        super.onSaveInstanceState(outState)
    }

Кто-нибудь знает, как это исправить?

0 ответов

Другие вопросы по тегам