Bug 36448 - App Crashes With "Unable to find resource ID #0x1" After Rotating Device
Summary: App Crashes With "Unable to find resource ID #0x1" After Rotating Device
Status: RESOLVED INVALID
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.0.0
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-12-01 22:50 UTC by Jimmy [MSFT]
Modified: 2015-12-15 18:40 UTC (History)
0 users

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 INVALID

Description Jimmy [MSFT] 2015-12-01 22:50:12 UTC
### Overview
In some apps using the new FormsAppCompatActivity in Forms 2.0, rotating the device’s screen causes a crash with the stack trace:

Android.Content.Res.Resources+NotFoundException: Unable to find resource ID #0x1
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <filename unknown>:0
  at Android.Runtime.JNIEnv.CallNonvirtualVoidMethod (IntPtr jobject, IntPtr jclass, IntPtr jmethod) [0x00083] in /Users/builder/data/lanes/2098/3efa14c4/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:1010
  at Android.App.Activity.OnStart () [0x00058] in /Users/builder/data/lanes/2098/3efa14c4/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.App.Activity.cs:4875
  at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnStart () [0x00000] in <filename unknown>:0
  at Android.App.Activity.n_OnStart (IntPtr jnienv, IntPtr native__this) [0x00009] in /Users/builder/data/lanes/2098/3efa14c4/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.App.Activity.cs:4859
  at at (wrapper dynamic-method) System.Object:2037fc7a-6816-46e0-89c2-0119095d9023 (intptr,intptr)
  at --- End of managed exception stack trace ---
  at android.content.res.Resources$NotFoundException: Unable to find resource ID #0x1
  at at android.content.res.Resources.getResourceName(Resources.java:2070)
  at at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1018)
  at at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1207)
  at at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1189)
  at at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:2001)
  at at android.support.v4.app.FragmentController.dispatchActivityCreated(FragmentController.java:165)
  at at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:507)
  at at md5b60ffeb829f638581ab2bb9b1a7f4f3f.FormsAppCompatActivity.n_onStart(Native Method)
  at at md5b60ffeb829f638581ab2bb9b1a7f4f3f.FormsAppCompatActivity.onStart(FormsAppCompatActivity.java:102)
  at at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1236)
  at at android.app.Activity.performStart(Activity.java:6006)
  at at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2313)
  at at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2415)
  at at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3975)
  at at android.app.ActivityThread.access$1000(ActivityThread.java:152)
  at at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1334)
  at at android.os.Handler.dispatchMessage(Handler.java:102)
  at at android.os.Looper.loop(Looper.java:135)
  at at android.app.ActivityThread.main(ActivityThread.java:5301)
  at at java.lang.reflect.Method.invoke(Native Method)
  at at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:723)
  at at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:613)


### Environment Info 
=== Xamarin Studio ===

Version 5.10 (build 871)
Installation UUID: 18b43ec3-c504-44af-9656-8689dfc73e07
Runtime:
Mono 4.2.1 (explicit/6dd2d0d)
GTK+ 2.24.23 (Raleigh theme)

Package version: 402010102

=== Xamarin.Profiler ===

Not Installed

=== Xamarin.Android ===

Version: 6.0.0.34 (Business Edition)
Android SDK: /Users/JacobBechPoulsen/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
2.3   (API level 10)
4.0.3 (API level 15)
4.4   (API level 19)
5.0   (API level 21)
5.1   (API level 22)
6.0   (API level 23)

SDK Tools Version: 24.4.1
SDK Platform Tools Version: 23.0.1
SDK Build Tools Version: 21.1.2

Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Xamarin Android Player ===

Version: 0.6.5
Location: /Applications/Xamarin Android Player.app

=== Apple Developer Tools ===

Xcode 7.1.1 (9081)
Build 7B1005

=== Xamarin.Mac ===

Not Installed

=== Xamarin.iOS ===

Version: 9.2.1.51 (Business Edition)
Hash: 3c0ec35
Branch: master
Build date: 2015-11-12 13:05:39-0500

=== Build Information ===

Release ID: 510000871
Git revision: 4e9c5abb5ffdae12ba02ac49da83f8b2011dbb88
Build date: 2015-11-12 06:02:54-05
Xamarin addins: 55007ed0e56436f385d8e26394a45be563abc7e8
Build lane: monodevelop-lion-cycle6

=== Operating System ===

Mac OS X 10.11.1
Darwin Jacobs-MacBook-Pro.local 15.0.0 Darwin Kernel Version 15.0.0
    Sat Sep 19 15:53:46 PDT 2015
    root:xnu-3247.10.11~1/RELEASE_X86_64 x86_64
Comment 2 Jimmy [MSFT] 2015-12-15 18:40:10 UTC
The Main activity class was missing "ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation" in it's declaration.