0
votes

I'm trying to learn XamarinForms and I just made this app (using Visual Studio 2017 15.4.4.) that displays a ListView with colors (from chapter 8 in this book https://developer.xamarin.com/guides/xamarin-forms/creating-mobile-apps-xamarin-forms/). Basically it has a ColorView class derived from ContentView for the layout of each individual color item and a ColorViewList which is the main page that displays the list of colors.

Now here's the problem: it runs fine on UWP but not on Android where it just displays an empty scrollable white page when deploying through XamarinLive and just a blank page then immediately closing when installed through an APK (I've also had numerous issues with XamarinLive sometimes refusing to connect and the VS Android simulator just refuses to deploy but that's beside the question).

Any ideas what is causing this? Perhaps related to the ColorName property that converts the string into an actual color?

Here is the project I made https://github.com/TJorj/ColorViewList

I've also downloaded the sample from Xamarin https://github.com/TJorj/xamarin-forms-book-samples/tree/master/Chapter08/ColorViewList and it seems to behave in the same way as my own.

1
I have run your posted project, it runs fine on local emulator, so I don't think it's project's problem. Could you please try run the project on google emulator or on a real device?Elvis Xia - MSFT
@ElvisXia-MSFT I'm not sure what you mean by "google emulator". I managed to get the Android Emulator in Visual Studio to run but the deploy fails with an "Install failed no matching abis failed to extract native libraries" error. I manged to get it work in Debug mode deploying to a real device through USB but strangely it still crashes in Release mode.FullStackOverflowDev
Could you please tell me which emulator are you using exactly? I mean the full name of the emulator.Elvis Xia - MSFT
@ElvisXia-MSFT It's the Android 7.1.1 emulator that comes when installing the Android SDK. I managed to get the app working in Debug mode on the emulator by setting the CPU/ABI to Google APIs Intel Atom (x86). Release version still fails on both live and emulator though.FullStackOverflowDev

1 Answers

0
votes

emulator that comes when installing the Android SDK. I managed to get the app working in Debug mode on the emulator by setting the CPU/ABI to Google APIs Intel Atom (x86). Release version still fails on both live and emulator though

In order to run a release build of android app, you will need to sign the built apk first, you can refer to Signing the Android Application Package for how to sign your app.

Even you got your released app run in Device/Emulator, it is not an option to debug it. You still need debug mode to debug your app.