Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apps crash/restart when linking is enabled #2

Open
LordZoltan opened this issue Apr 7, 2014 · 5 comments
Open

Apps crash/restart when linking is enabled #2

LordZoltan opened this issue Apr 7, 2014 · 5 comments

Comments

@LordZoltan
Copy link
Owner

I have observed a crash when linking is enabled and when Android starts a new process but restores an application back to a previous activity on which PagerSlidingTabStrip is hosted.

Looking through the log you will see a Java IllegalStateException being raised with the text something like - 'super.OnRestoreInstanceState was not called'

One way I found to repro this (might not work in all cases, however) is to start your app, and press Home when you have a tabbed activity showing. Then go to Android settings and terminate the process from the Apps sub-settings screen.

Now go back to your app (either from recent or by re-launching) and it should restart after loading.

The problem is caused by the linker stripping something (but I don't know what) out of the library when you enable linking. The easiest way around it is simply to exclude PagerSlidingTabStrip.dll from being linked.

A more thorough investigation could be conducted to find out exactly which methods need to be retained at all costs, however.

@egfconnor
Copy link

I've found this issue too. Easy way to reproduce is turn on the Android developer option of "Kill Activities" and then navigate to another activity from the one containing the TabStrip and then come back to it.

@egfconnor
Copy link

My exception I get is: java.lang.RuntimeException: Parcel android.os.Parcel@4245faa8: Unmarshalling unknown type code 7209057 at offset 376

Is this related?

@LordZoltan
Copy link
Owner Author

Yeah, that and the one I mention in the OP is the kind of thing that happens. Not linking the library should fix it. It's really hard to diagnose the exact problem in this case without instructing Xamarin not to strip any of the library, and then selectively start to remove those restrictions until you can repro it again.

Equally, there was another bug earlier in the codebase where you'd see this even if you weren't linking - basically caused by a bug in the state save & restore code - that should be fixed now... Hopefully! Certainly my first app, the JobServe app, no longer gets this problem.

@egfconnor
Copy link

@LordZoltan thanks for the quick reply. Updated my library to the latest codebase and it fixed it for me. Thanks for the help and library!

@LordZoltan
Copy link
Owner Author

I'm glad an update solved the problem :)

You're very welcome - I'm very pleased to have been able to bring this excellent library to the army of Xamarin .Net devs out there :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants