Bug 48862 - App crash "Unable to find resource ID #0x1" when changing App.Current.MainPage
Summary: App crash "Unable to find resource ID #0x1" when changing App.Current.MainPage
Status: RESOLVED DUPLICATE of bug 42815
Alias: None
Product: Android
Classification: Xamarin
Component: Mono runtime / AOT Compiler ()
Version: 6.0.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Marek Habersack
URL:
Depends on:
Blocks:
 
Reported: 2016-12-03 10:46 UTC by Novak Savic
Modified: 2017-06-02 08:43 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 42815

Description Novak Savic 2016-12-03 10:46:03 UTC
We are experiencing this problem pretty often

Bellow are info regarding crash. Just let me know if I can provide you more information.

Android Build: 74.01.01.0006 release-keys
Manufacturer: Foxconn International Holdings Limited
Model: CN51 NCU
Thread: main-1
CrashReporter Key: 76A149FF-D2B6-1025-D234-F5F0286EC5376DE6FCE4
Start Date: Fri Dec 02 19:34:39 GMT+01:00 2016
Date: Fri Dec 02 19:52:03 GMT+01:00 2016
Format: Xamarin

android.content.res.Resources$NotFoundException: Unable to find resource ID #0x1
	at android.content.res.Resources.getResourceName(Resources.java:2281)
	at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1059)
	at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252)
	at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:742)
	at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617)
	at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:517)
	at android.os.Handler.handleCallback(Handler.java:739)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at android.os.Looper.loop(Looper.java:148)
	at android.app.ActivityThread.main(ActivityThread.java:5417)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Xamarin caused by: Android.Content.Res.Resources+NotFoundException: Unable to find resource ID #0x1
  --- End of managed Android.Content.Res.Resources+NotFoundException stack trace ---
android.content.res.Resources$NotFoundException: Unable to find resource ID #0x1
	at android.content.res.Resources.getResourceName(Resources.java:2281)
	at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1059)
	at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252)
	at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:742)
	at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617)
	at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:517)
	at android.os.Handler.handleCallback(Handler.java:739)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at android.os.Looper.loop(Looper.java:148)
	at android.app.ActivityThread.main(ActivityThread.java:5417)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Comment 1 Novak Savic 2016-12-03 10:48:13 UTC
And another similar:

Version Name: 1.0
Android: 6.0
Android Build: 74.01.01.0006 release-keys
Manufacturer: Foxconn International Holdings Limited
Model: CN51 NCU
Thread: main-1
CrashReporter Key: 76A149FF-D2B6-1025-D234-F5F0286EC5376DE6FCE4
Start Date: Fri Dec 02 19:34:39 GMT+01:00 2016
Date: Fri Dec 02 19:52:03 GMT+01:00 2016

android.content.res.Resources$NotFoundException: Unable to find resource ID #0x1
	at android.content.res.Resources.getResourceName(Resources.java:2281)
	at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1059)
	at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252)
	at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:742)
	at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617)
	at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:517)
	at android.os.Handler.handleCallback(Handler.java:739)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at android.os.Looper.loop(Looper.java:148)
	at android.app.ActivityThread.main(ActivityThread.java:5417)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Comment 2 Marek Habersack 2017-01-10 12:06:04 UTC
Would you mind providing a small app that reproduces the issue?
Comment 3 Chris McBride 2017-03-27 17:59:50 UTC
I'm seeing the same issue. While logging in and logging out we swap out the MainPage. Looks like on Android M and up, we sometimes get this crash (shows up in Insights, I have yet to repro it)
Lately this is mostly happening on Logging out, but I've seen very similar stack traces on logging in.
Looks like it started happening after we turned on multidex. 


If this is happening due to multidex, I'm not sure if I can create a small app to reproduce the issue.
The resource id varies between 0x1 and 0xf.
We were using Xamarin Forms 2.3.2.127 when this first started occurring.
Our main activity is decorated:
    [Activity(Name="our.droid.MainActivity", MainLauncher = false, ConfigurationChanges = ConfigChanges.ScreenSize, Theme = "@style/Theme.Main", ScreenOrientation = ScreenOrientation.Portrait, WindowSoftInputMode = global::Android.Views.SoftInput.AdjustPan)]


Here is our stack trace:
Java.Interop.JniEnvironmentUnable to find resource ID #0x6
Raw
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <f27039c598834ea7a7f946c865c2e2b7>:0 
  at Java.Interop.JniEnvironment+InstanceMethods.CallBooleanMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method) [0x00084] in <5d0da439400e4472845b738cfbb5a09c>:0 
  at Android.Runtime.JNIEnv.CallBooleanMethod (System.IntPtr jobject, System.IntPtr jmethod) [0x0000e] in <4db2d40884194fdc8feb0df3089cee16>:0 
  at Android.Support.V4.App.FragmentManagerInvoker.ExecutePendingTransactions () [0x00033] in <de45b3c05cd74364a9a47a1d49ca2721>:0 
  at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.Dispose (System.Boolean disposing) [0x00083] in <95895bcb439e42ebb8e7134a545f1acc>:0 
  at Java.Lang.Object.Dispose () [0x00000] in <4db2d40884194fdc8feb0df3089cee16>:0 
  at Xamarin.Forms.Platform.Android.AppCompat.Platform.SetPage (Xamarin.Forms.Page newRoot) [0x0003f] in <95895bcb439e42ebb8e7134a545f1acc>:0 
  at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.InternalSetPage (Xamarin.Forms.Page page) [0x0001a] in <95895bcb439e42ebb8e7134a545f1acc>:0 
  at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.AppOnPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs args) [0x0001e] in <95895bcb439e42ebb8e7134a545f1acc>:0 
  at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00012] in <b0fc14d4e5b04749b7241d1235a68329>:0 
  at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in <b0fc14d4e5b04749b7241d1235a68329>:0 
  at BillMo.BillMoApp.OnPropertyChanged (System.String propertyName) [0x00000] in <1dd0c3436f2445f3ac59ca33b9b74f37>:0 
  at Xamarin.Forms.Application.set_MainPage (Xamarin.Forms.Page value) [0x0008b] in <b0fc14d4e5b04749b7241d1235a68329>:0 
  at BillMo.BillMoApp.CreateNavPage (Xamarin.Forms.Page page) [0x00037] in <1dd0c3436f2445f3ac59ca33b9b74f37>:0 
  at Wallet.App.SetLoginPage () [0x00016] in <705b5130a9bc4fe3a9aa5bc2dbe5e2ae>:0 
  at BillMo.BillMoApp.Logout () [0x00079] in <1dd0c3436f2445f3ac59ca33b9b74f37>:0 
  at BillMo.BillMoApp+<>c.<MyForceLogout>b__155_0 () [0x00000] in <1dd0c3436f2445f3ac59ca33b9b74f37>:0 
  at Java.Lang.Thread+RunnableImplementor.Run () [0x0000b] in <4db2d40884194fdc8feb0df3089cee16>:0 
  at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <4db2d40884194fdc8feb0df3089cee16>:0 
  at (wrapper dynamic-method) System.Object:8150d02d-6c17-4c9d-8ecc-4d497da546a7 (intptr,intptr)
  --- End of managed Java.Lang.RuntimeException stack trace ---
android.content.res.Resources$NotFoundException: Unable to find resource ID #0x6
	at android.content.res.Resources.getResourceName(Resources.java:3677)
	at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1059)
	at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252)
	at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:742)
	at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617)
	at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:570)
	at mono.java.lang.RunnableImplementor.n_run(Native Method)
	at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:30)
	at android.app.Activity.runOnUiThread(Activity.java:6035)
	at mono.java.lang.RunnableImplementor.n_run(Native Method)
	at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:30)
	at android.os.Handler.handleCallback(Handler.java:739)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	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)
Comment 4 Chris McBride 2017-03-27 18:11:45 UTC
This might be a duplicate of 42815
Comment 5 Marek Habersack 2017-03-27 20:07:31 UTC
Indeed it looks like a duplicate of #42815

*** This bug has been marked as a duplicate of bug 42815 ***