1
votes

So I have a Xamarin Forms Shell App, with Shellcontents set as like this:

<Shell etc etc>
<ShellContent ContentTemplate="Temp1" Route="routeA" Title="titleA" />    
<ShellContent ContentTemplate="Temp2" Route="routeB" Title="titleB" />    
    <MenuItem Text="{x:Static rx:AppResources.Logout}" Command="{Binding LogoutCommand}"/>

</Shell>

When launched, ShellContent A shows up all good. But the moment I touch titleB, I get this stupid error. I have not been able to figure it out, where is this error coming from. Any ideas where should I look?

 No package ID ff found for ID 0xffffffff.
[AndroidRuntime] Shutting down VM
[AndroidRuntime] FATAL EXCEPTION: main

[AndroidRuntime] android.content.res.Resources$NotFoundException: Unable to find resource ID #0xffffffff
[AndroidRuntime]    at android.content.res.ResourcesImpl.getResourceTypeName(ResourcesImpl.java:334)
[AndroidRuntime]    at android.content.res.Resources.getResourceTypeName(Resources.java:2300)
[AndroidRuntime]    at androidx.fragment.app.FragmentAnim.loadAnimation(FragmentAnim.java:79)
[AndroidRuntime]    at androidx.fragment.app.DefaultSpecialEffectsController$AnimationInfo.getAnimation(DefaultSpecialEffectsController.java:774)
[AndroidRuntime]    at androidx.fragment.app.DefaultSpecialEffectsController.startAnimations(DefaultSpecialEffectsController.java:144)
[AndroidRuntime]    at androidx.fragment.app.DefaultSpecialEffectsController.executeOperations(DefaultSpecialEffectsController.java:120)
[AndroidRuntime]    at androidx.fragment.app.SpecialEffectsController.executePendingOperations(SpecialEffectsController.java:294)
[AndroidRuntime]    at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2190)
[AndroidRuntime]    at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2088)
[AndroidRuntime]    at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1990)
[AndroidRuntime]    at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:524)
[AndroidRuntime]    at android.os.Handler.handleCallback(Handler.java:938)
[AndroidRuntime]    at androidx.fragment.app.DefaultSpecialEffectsController.startAnimations(DefaultSpecialEffectsControlleer.dispatchMessage(Handler.java:99)
[AndroidRuntime]    at android.os.Looper.loop(Looper.java:246)
[AndroidRuntime]    at android.app.ActivityThread.main(ActivityThread.java:8430)
[AndroidRuntime]    at java.lang.reflect.Method.invoke(Native Method)
[AndroidRuntime]    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:596)
[AndroidRuntime]    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
2
Yep, I lowered the package level. Everything is good. There is no good solution to this other than lowering. Xamarin is not doing any more development on 5.0.2012, it is all Maui from now. - zyzzyxx
fyi - I fixed it by removing all the AndroidX dependencies from the project. Since none of my nugets relied on old Support libs, it seems to work. - InquisitorJax

2 Answers

0
votes

I do not have the Temp1 and Temp2. I create a Shell tenplate to test. It works on myside. You could check the code below.

Xaml:

<ShellContent
    Title="titleA"
    ContentTemplate="{DataTemplate local:ItemsPage}"
    Route="routeA" />
<ShellContent
    Title="titleB"
    ContentTemplate="{DataTemplate local:AboutPage}"
    Route="routeB" />

<MenuItem Command="{Binding LogoutCommand}" Text="Page1" />

Code hebind:

public partial class AppShell : Xamarin.Forms.Shell
{
    public ICommand LogoutCommand => new Command(async () => await Shell.Current.GoToAsync("page1"));

    public AppShell()
    {
        InitializeComponent();
        Routing.RegisterRoute("page1", typeof(Page1));
        this.BindingContext = this;
    }
}
0
votes

I was able to correct this bug when I downgraded Xamarin.Google.Android.Material to v1.2.1.1 following a tip from here:

https://github.com/xamarin/Xamarin.Forms/issues/13843