Log in or register to post comments

Vuforia Unity Android Notifications Error Crash

June 21, 2013 - 7:01am #1

Hi,

 

When using the Vuforia plugin with Unity and deploying to Android, we experience a 100% crash issue when using local notifications.

We use the Etcetera plugin by Prime31, and have posted this issue on their fourm also. The STR is as follows:

1. Implement the Vuforia plugin in Unity3d.

2. Import the Etcetera plugin.

3. Use Etcetera Android to fire a local notification.

4. Press the menu button on the device to background the app.

5. Swipe down to show the notification centre.

6. Wait till the notification appears.

7. Tap on the notification.

Expected: app returns to the foreground.

Actual: app crashes; Android OS informs that app has stopped running.

 

Error log below:

06-20 16:18:21.255: E/AndroidRuntime(14821): FATAL EXCEPTION: main
06-20 16:18:21.255: E/AndroidRuntime(14821): java.lang.Error: FATAL EXCEPTION [main]
06-20 16:18:21.255: E/AndroidRuntime(14821): Unity version     : 4.1.2f1
06-20 16:18:21.255: E/AndroidRuntime(14821): Device model      : LGE Nexus 4
06-20 16:18:21.255: E/AndroidRuntime(14821): Device fingerprint: google/occam/mako:4.2.2/JDQ39/573038:user/release-keys
06-20 16:18:21.255: E/AndroidRuntime(14821): Caused by: java.lang.NullPointerException
06-20 16:18:21.255: E/AndroidRuntime(14821):     at com.unity3d.player.g.a(Unknown Source)
06-20 16:18:21.255: E/AndroidRuntime(14821):     at com.unity3d.player.g.b(Unknown Source)
06-20 16:18:21.255: E/AndroidRuntime(14821):     at com.unity3d.player.UnityPlayer.resume(Unknown Source)
06-20 16:18:21.255: E/AndroidRuntime(14821):     at com.unity3d.player.UnityPlayer.a(Unknown Source)
06-20 16:18:21.255: E/AndroidRuntime(14821):     at com.unity3d.player.UnityPlayer.init(Unknown Source)
06-20 16:18:21.255: E/AndroidRuntime(14821):     at com.qualcomm.QCARUnityPlayer.QCARPlayerSharedActivity.initUnityPlayer(QCARPlayerSharedActivity.java:5

 

Our investigations lead us to conclude this problem is occuring because Vuforia extends the Unity Activity. Currently, we lack sufficient information to write a workaround for this issue, and hope that this post will help us. We are happy to write our own local notification library, but since we don't know exactly why this issue is occuring, we worry that we will run into the same problem when we finish.

Nicholas Bellerophon
Mobile Apps Developer
Yummi Media Group

Vuforia Unity Android Notifications Error Crash

June 25, 2013 - 9:07am #5

Right, 2.5 release indeed includes a fix for Unity apps that were never sleeping.

Glad to hear that this fix also solved your problem!

 

Vuforia Unity Android Notifications Error Crash

June 25, 2013 - 8:40am #4

Hi,

 

In the course of our investigations, we came across another thread in this forum relating to issues putting apps to sleep. A fix for this happened in the latest build, so we upgraded to that and our notification problem was fixed as well.

So, all is well. If anyone has this issue, please try upgrading to the latest version of Vuforia.

Vuforia Unity Android Notifications Error Crash

June 25, 2013 - 2:34am #3

It does add to the manifest, but I'm not sure if it is extending the UnityPlayer activity. Have a look at the manifest generated from the Prime31 Etcetera Android plugin (in a clean project without Vuforia or anything else):

<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.unity3d.player"
	android:installLocation="preferExternal"
	android:theme="@android:style/Theme.NoTitleBar"
    android:versionCode="1"
    android:versionName="1.0">
    <supports-screens
        android:smallScreens="true"
        android:normalScreens="true"
        android:largeScreens="true"
        android:xlargeScreens="true"
        android:anyDensity="true"/>

    <application
		android:icon="@drawable/app_icon"
        android:label="@string/app_name"
        android:debuggable="true">
        <activity android:name="com.unity3d.player.UnityPlayerProxyActivity"
                  android:launchMode="singleTask"
                  android:label="@string/app_name"
                  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>
        </activity>
        <activity android:name="com.unity3d.player.UnityPlayerActivity"
                  android:launchMode="singleTask"
                  android:label="@string/app_name"
                  android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
        </activity>
        <activity android:name="com.unity3d.player.UnityPlayerNativeActivity"
                  android:launchMode="singleTask"
                  android:label="@string/app_name"
                  android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
            <meta-data android:name="android.app.lib_name" android:value="unity" />
            <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
        </activity>
    
		    <activity android:name="com.prime31.EtceteraProxyActivity"></activity>
			<activity android:name="com.prime31.WebViewActivity" android:configChanges="orientation"></activity>
			<activity android:name="com.prime31.P31VideoPlayerActivity" android:configChanges="keyboard|keyboardHidden|orientation"></activity>
			<receiver android:name="com.prime31.AlarmManagerReceiver"></receiver>
</application>

	    <uses-permission android:name="android.permission.INTERNET"/>
	    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
		<uses-permission android:name="android.permission.GET_TASKS"/>

</manifest>

So... although we do see the three UnityPlayer activities written in this manifest, I'm not clear whether this is altering them in any way from their default values, and if so how. So I'm going to investigate that next, and also continue researching Android activities and intents generally.

Vuforia Unity Android Notifications Error Crash

June 21, 2013 - 11:29am #2

Does the Prime31 plugin attempt to extend the Unity Activity as well? That has been a cause of problems for some of their plugins in the past, when attempting to use them w/ Vuforia.

Log in or register to post comments