Lumino Webdesign og SEO
Nettleseren din må oppgraderes. Du har Internet Explorer version {%ieversion%}. Gå til www.microsoft.com for å laste ned siste versjon av Internet Explorer.

Tech blogg

Android, Help with a nasty 'bug' - Android.Content.Res.Resources+NotFoundException

Android logo

Just thought I would share this piece of information about a "bug" that took me a lot of time to figure out. Maybe the solution I found can help anyone with a similar problem...

While developing an app using Xamarin forms, I ran into a problem with the android solution (iOS worked without a glitch). On Android, the app crashed consistently when opening a page. I, of course, assumed that it was something wrong with the code in that particular page....

The error message I got was the cryptic 'Android.Content.Res.Resources+NotFoundException: 'Unable to find resource ID #0x0'.

The error messge and Googling led me to believe that there was something wrong - or a missing - resource, like an image or something. However, after a lot of research, I finally figured out that the crash had to do with a call to PushModalAsync(), although I had no idea why... and if I changed to PushAsync() instead, there was no problem.

The solution that finally solved this issue for me can be found in the styles.xml file. I had assigned a value of #00ffffff to the android:windowBackground. It turns out that any hex color in <item name="android:windowBackground">#000000</item> will throw this exception.

The solution is to assign the hex color in the colors.xml file, and then reference this color in styles.xml like <item name="android:windowBackground">@color/window_background</item>

This is the 'bug' report that got me on the right track... Exception thrown on PushModalAsync() when android:windowBackground set as HEX

Hope this helps :)

André Vold

Tech blogg
André Vold

Her er en rask liten BLOGGER BIO for å fortelle litt om min bakgrunn - og hvorfor jeg valgte programmering som fagfelt.

Jeg vokste opp i Norge, men gikk på universitet i USA. Jeg er sivilingeninør med grad innen "Computer Engineering" fra Arizona State University. Etter utdannelsen flyttet jeg tilbake til Norge, begynte å arbeide på Norsk Data og senere IBM, og tok videreutdannelse på BI innen Master of Management. Etter flere år som divisjonsdirektør i IBM Norge, valgte jeg å starte e-læringsfirmaet Apropos Internett AS . Senere startet jeg også ViroSafe Norge AS som importerer og distribuerer anti-malware og anti-virus software og hardware.

Det har alltid vært essensielt for meg å holde meg oppdatert innen teknologiske endringer og trender - ikke bare for å kunne holde programmeringskunnskaper på topp, men også for min suksess som gründer.

Lumino blogger omfatter en rekke temaer som har vært essensiell for min virksomhet, og som derfor kan være relevant for din.
Forsiden
Referanser
Tech blogg
Personvern

Søkeresultater