Facebook ProfilePictureView causing FAILED BINDER TRANSACTION - android

Been pulling my hair out trying to figure out why my app keeps crashing, I've nailed it down to having this in my main activities layout XML.
<com.facebook.login.widget.ProfilePictureView
android:id="#+id/pp"
android:layout_gravity="center"
android:layout_height="match_parent"
android:layout_width="match_parent">
</com.facebook.login.widget.ProfilePictureView>
Whenever I have this in my main activity layout, and I try to create any new intents (new activities, facebook sign in or requesting permissions) My app crashed with a FAILED BINDER TRANSACTION and TransactionTooLargeException.
This continues to happen when I remove the profile picture code in the activity class. It seems to be the view appearing that's casing this but I cannot think why.
This occurs not on my main testign device, but on all emulators and other devices Ive tried.
stacktrace
03-13 15:29:21.347 28962-28962/uk.co.claytapp.taggerbath E/JavaBinder: !!! FAILED BINDER TRANSACTION !!! (parcel size = 1443592)
03-13 15:29:21.348 28962-28962/uk.co.claytapp.taggerbath D/AndroidRuntime: Shutting down VM
03-13 15:29:21.348 28962-28962/uk.co.claytapp.taggerbath E/AndroidRuntime: FATAL EXCEPTION: main
Process: uk.co.claytapp.taggerbath, PID: 28962
java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 1443592 bytes
at android.app.ActivityThread$StopInfo.run(ActivityThread.java:3752)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Caused by: android.os.TransactionTooLargeException: data parcel size 1443592 bytes
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:615)
at android.app.ActivityManagerProxy.activityStopped(ActivityManagerNative.java:3606)
at android.app.ActivityThread$StopInfo.run(ActivityThread.java:3744)
at android.os.Handler.handleCallback(Handler.java:751) 
at android.os.Handler.dispatchMessage(Handler.java:95) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6077) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755) 

This most likely happens in the onSaveInstanceState(Bundle outState) method of the activity you are navigating away from.
To fix it, add android:saveEnabled="false" to your ProfilePictureView like so:
<com.facebook.login.widget.ProfilePictureView
android:id="#+id/profilePicture"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:saveEnabled="false"
facebook:com_facebook_preset_size="normal" />
This will prevent Android to call ProfilePictureView's own onSaveInstanceState method (the view hierarchy is stored by the Activity anyway so it won't hurt).

Related

Adding Bottom Sheet in Recycler view onclick listener

I have a Recyclerview and some items in it like imageviews and textviews.
I need to open a bottom sheet using model class, when I click the imageview in the recyclerview.
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.app.storeeval, PID: 21795
java.lang.IllegalStateException: Fragment BottomSheetDialog{6a325f6} (605326f6-5f11-4029-9b55-15c136b1aa75) has not been attached yet.
at androidx.fragment.app.Fragment.getChildFragmentManager(Fragment.java:1075)
at com.app.storeeval.store_elements_adapter$ElementsViewHolder$1.onClick(store_elements_adapter.java:86)
at android.view.View.performClick(View.java:6616)
at android.view.View.performClickInternal(View.java:6593)
at android.view.View.access$3100(View.java:785)
at android.view.View$PerformClick.run(View.java:25929)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6806)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
I/Process: Sending signal. PID: 21795 SIG: 9
I have tried some methods to resolve these errors from here but I couldn't succeed.
please help me in clearing this error.

ArrayIndexOutOfBounds LifecycleRegistry.popParentState

I came across an exception on which I do not have a clue on how to fix it. Here is the stacktrace:
Caused by: java.lang.ArrayIndexOutOfBoundsException: length=10; index=-1
at java.util.ArrayList.remove(ArrayList.java:480)
at android.arch.lifecycle.LifecycleRegistry.popParentState(LifecycleRegistry.java:194)
at android.arch.lifecycle.LifecycleRegistry.forwardPass(LifecycleRegistry.java:293)
at android.arch.lifecycle.LifecycleRegistry.sync(LifecycleRegistry.java:332)
at android.arch.lifecycle.LifecycleRegistry.moveToState(LifecycleRegistry.java:137)
at android.arch.lifecycle.LifecycleRegistry.handleLifecycleEvent(LifecycleRegistry.java:123)
at android.arch.lifecycle.ReportFragment.dispatch(ReportFragment.java:121)
at android.arch.lifecycle.ReportFragment.onStart(ReportFragment.java:81)
at android.app.Fragment.performStart(Fragment.java:2378)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1027)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1171)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1153)
at android.app.FragmentManagerImpl.dispatchStart(FragmentManager.java:2048)
at android.app.FragmentController.dispatchStart(FragmentController.java:188)
at android.app.Activity.performStart(Activity.java:6978)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2937)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3045) 
at android.app.ActivityThread.-wrap14(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6776) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386) 
I'm using android.arch.lifecycle:extensions:1.1.1.
UPDATE
I got more informations.
This is happening when I start an activity for result from within a Fragment by calling Fragment.startActivityForResult(). This Fragment is in "strange" place. Here it is the structure of its holding Activity
- HoldingActivity
-- HoldingFragment
--- FragmentPagerAdapter
---- MyFragment // This is where I call the startActivityForResult
Another point that might help is that every level of the HoldingActivity is using ViewDataBinding.setLifecycleOwner(this) and they all have a ViewModel attached to it.
The started Avtivity is hosting a Fragment and they also both use ViewDataBinding.setLifecycleOwner(this) and have a ViewModel.
Let me know if anything else could help resolve this issue, thanks.

Android : Window couldn't find content container view after adding file in raw folder

Am getting an Window couldn't find content container view. This error asking when the app is going to checking the permission
I noticed that for the wear app , am copying the wear apk into the raw folder.
Its having around 2.5 Mb. After adding this am getting this crash
java.lang.RuntimeException: Window couldn't find content container view
at com.android.internal.policy.PhoneWindow.generateLayout(PhoneWindow.java:4614)
at com.android.internal.policy.PhoneWindow.installDecor(PhoneWindow.java:4683)
at com.android.internal.policy.PhoneWindow.getDecorView(PhoneWindow.java:2263)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4276)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3361)
at android.app.ActivityThread.access$1100(ActivityThread.java:222)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7229)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Comscore library was causing this issue in my case. Try removing it.

illegal state exception from startactivity

Hi guys I am getting the following exception
ERR-5e1e9c7f83ba94b45017220ad632c|StackTrace:java.lang.IllegalStateException: Fragment Gallery{d6a81c0} not attached to Activity
--------- Stack trace ---------
android.support.v4.app.Fragment.startActivity(Fragment.java:914)
mypackage.Gallery$openReceiptImage.onPostExecute(Gallery.java:1604)
mypackage.Gallery$openReceiptImage.onPostExecute(Gallery.java:1424)
android.os.AsyncTask.finish(AsyncTask.java:651)
android.os.AsyncTask.access$500(AsyncTask.java:180)
android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:668)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:148) android.app.ActivityThread.main(ActivityThread.java:7325) java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
------------------------------- --------- Cause --------- -------------------------------
My code is as follows
Intent fullimage=new Intent(mContext, Preview.class);
startActivity(fullimage);
Here mContext is Context and I am calling this from Fragment. Preview is Activity. I beleieve these informations are enough. And also I am not getting this issue always.
Can anyone tell me what could be the reason for this issue.
Thanks in Advance.
Issue is fixed
if(isAdded){ }
Is used to check whether that fragment is attached to Activity or not

Android strange ClassCastException

A few days ago we started to receive some crash reports from users using our app, but the stracktrace is really strange. It happens only on Samsung G900f (S5) and I can't reproduce it and decide to post a question here.
The stacktrace shows this:
Caused by java.lang.ClassCastException: android.support.design.widget.CollapsingToolbarLayout cannot be cast to android.support.design.widget.CollapsingToolbarLayout
at com.packageName.profile.ProfileFragment.onViewCreated(SourceFile:423)
at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1086)
at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1248)
at android.support.v4.app.BackStackRecord.run(SourceFile:738)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(SourceFile:1613)
at android.support.v4.app.FragmentController.execPendingActions(SourceFile:330)
at android.support.v4.app.FragmentActivity.onStart(SourceFile:547)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1234)
at android.app.Activity.performStart(Activity.java:6258)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2621)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2725)
at android.app.ActivityThread.access$900(ActivityThread.java:172)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1422)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5834)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)
It is a Fragment which contains CollapsingToolbarLayout with initialization and use all correct, but not sure why this happens.
We got some other ClassCastExceptions with different classes from the same device. For example:
Caused by java.lang.ClassCastException:
com.packageName.model.VideoMeta cannot be cast to
com.packageName.model.VideoMeta
where VideoMeta is a class which implements Parcelable and this exception occurs in class Video which implements Parcelable too:
private Video(Parcel in) {
id = in.readLong();
postId = in.readString();
url = in.readString();
thumb = in.readString();
meta = (VideoMeta) in.readValue(VideoMeta.class.getClassLoader());
}
But that's not the end...
Caused by java.lang.ClassCastException:
android.support.design.widget.AppBarLayout$LayoutParams cannot be cast to
android.support.design.widget.AppBarLayout$LayoutParams
I have no idea what can cause this exception and why it's happening, that's why posting it here.
Thanks in advance for any kind of help or suggestions!

Categories

Resources