Xamarin Forms (PCL) w/Android using FCM working in debug mode but not when pulled from Google Play

RonnieCyrierRonnieCyrier USMember ✭✭

I'm really having troubles here. I've successfully implemented FCM in my Xamarin Forms Android App. Everything works in Debug. I get token and token is registered with FCM. I am saving to DB for future use. I also can go to firebase console and send a message and everything works. If i put the app in the Alpha channel on google play, the token is create and saved to database. When I use the console to send a message, my app receives it (OnMessageReceived seems to be called but i cannot be certain) but then I get the error that says "Unfortunately, {App Name} has stopped." Anyone have any ideas.

Target framework is 7.1 supporting 4.4 and above.

I've tried several versions of the manifest Originally with only android.Permission.INTERNET but I've added some extra ones based on some suggestions from several other blogs/support questions.
Here is my current manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto"
package="com.APPNAME.android.app.APPNAME" android:versionCode="200165" android:versionName="3.0.0">
<uses-sdk android:minSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<application android:label="APPNAME" android:icon="@drawable/icon">
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver" android:exported="false" />
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver" android:enabled="true" android:exported="true"
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />

My packages are:
<package id="Xamarin.Firebase.Common" version="42.1021.1" targetFramework="monoandroid71" />
<package id="Xamarin.Firebase.Iid" version="42.1021.1" targetFramework="monoandroid71" />
<package id="Xamarin.Firebase.Messaging" version="42.1021.1" targetFramework="monoandroid71" />
<package id="Xamarin.Forms" version="" targetFramework="monoandroid71" />
<package id="Xamarin.GooglePlayServices.Ads" version="42.1021.1" targetFramework="monoandroid71" />
<package id="Xamarin.GooglePlayServices.Ads.Lite" version="42.1021.1" targetFramework="monoandroid71" />
<package id="Xamarin.GooglePlayServices.Base" version="42.1021.1" targetFramework="monoandroid71" />
<package id="Xamarin.GooglePlayServices.Basement" version="42.1021.1" targetFramework="monoandroid71" />
<package id="Xamarin.GooglePlayServices.Clearcut" version="42.1021.1" targetFramework="monoandroid71" />
<package id="Xamarin.GooglePlayServices.Gass" version="42.1021.1" targetFramework="monoandroid71" />
<package id="Xamarin.GooglePlayServices.Tasks" version="42.1021.1" targetFramework="monoandroid71" />

I would love some help on this. The error message is not very helpful. I'm not 100% sure how to check some logs on the android itself to see what is missing. I've tried LogCat Reader and aLogCat apps to get a better message but I must be doing something wrong there as I'm not getting anything relevant as far as I can tell.

Any ideas? Has anyone gotten a Xamarin.Forms project pushed up to beta working?

Best Answer


Sign In or Register to comment.