Unity android app crashes on start after upgrading to firebase unity sdk 5.4.4

2,198 views
Skip to first unread message

Sanket Kale

unread,
Feb 4, 2019, 11:05:47 AM2/4/19
to Firebase Google Group
Hi all,

I am facing this issue where the android app crashes immediately after start without much error info. It just says:

02-04 16:32:15.025 3894-4377/? E/Launcher.AllAppsList: Can't load postion for packageName: com.xxxx.xxxxxx activityName: com.google.firebase.MessagingUnityPlayerActivity

Now I am using Firebase Dynamic links, Messaging and Analytics and upon importing Firebase Messaging, a custom AndroidManifest.xml gets created in Assets>Plugins>Android folder with below contents:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.xxxx.xxxxxx" android:versionCode="1" android:versionName="1.0">
  <application android:theme="@style/UnityThemeSelector" android:label="@string/app_name" android:icon="@mipmap/app_icon" android:name="android.support.multidex.MultiDexApplication" android:hardwareAccelerated="true">
    <!-- The MessagingUnityPlayerActivity is a class that extends
         UnityPlayerActivity to work around a known issue when receiving
         notification data payloads in the background. -->
    <activity android:name="com.google.firebase.MessagingUnityPlayerActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
      <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
    </activity>
    <service android:name="com.google.firebase.messaging.MessageForwardingService" android:exported="false" />
  </application>
</manifest>


If I remove this AndroidManifest.xml I am able to build it and run the app normally. But with the AndroidManifest, I am not even able to start the app. Is there something I am missing out here?

FYI, I have been using firebase unity sdk in the project since version 1.1 and the issue started since version 5.4.4. I am using unity 2018.2.14f1 and recently upgraded my firebase unity SDK to 5.4.4. Upon some surfing, I found about this issue being raised on Github here, but the solution mentioned was not very clear. If somebody could please tell me what could I possibly be missing here?

Thanks in advance.

Regards,
Sanket Kale.

Sanket Kale

unread,
Feb 17, 2019, 8:53:38 PM2/17/19
to Firebase Google Group
Hello all,

To answer my own question, the crash was maybe due to adding android:name="android.support.multidex.MultiDexApplication" android:hardwareAccelerated="true". It did not come in the custom manifest after importing firebase unity SDK but I added it as it was there in previous custom manifest which was added with older firebase SDK version 1.1 in my project. Removing it and bringing the actual manifest added after importing latest firebase version fixed this crash. 

Also, as mentioned in the firebase docs, the custom manifest file is required for it to work. Deleting won't help, as the app will not receive notifications or won't open the app if it did. So make sure you keep the custom manifest file as it is and don't delete it.

Hope it helps.

Regards,
Sanket Kale.
Reply all
Reply to author
Forward
0 new messages