Native Android Activity plugin issue

Hi All!
For the past few days I’ve been pulling my hair, trying to find what causes a problem with a pretty simple plugin.
So here comes the explanation:

I am trying to create a simple plugin, that just starts a native android activity. The activity is to be transparent, because I do not really want to display anything to the user. Now, you may say that I should use a Service if I want no GUI, but just a background execution. Well, in my defense, I will say that I need it to be an activity so that I can start another activity for result. For now, I will just stick to the main native activity( skipping the one for result ) because the problem comes from it.

Here we begin:

  1. Entry point for the communication → getting an instance of the java class.
    Well, here is how I create the connection:
 public class SamplePlugin {
    	private static SampleUnity mInstance;
    	
    	public static SampleUnity GetInstance() {
    		if(mInstance == null) {
    			mInstance = new SampleUnity(UnityPlayer.currentActivity);
    		}
    		//Log.i("GET INSTANCE", "GET INSTANCE");
    		return mInstance;
    	}
    }

This way I get the instance of SampleUnity class:

 public class SampleUnity {
    	
    	private Activity mActivity;
    	
    	public SampleUnity( final Activity activity ) {
    		this.mActivity = activity;
    	}
    
    	public void StartNewActivity( ) {
    
    		Intent intent = new Intent(mActivity, NewActivity.class);
    
    		mActivity.startActivity(intent);
    	}
    }

Now let’s look at the new activity:

public class NewActivity extends Activity{
    
    	@Override
    	public void onCreate(final Bundle mSavedInstanceState) {
            super.onCreate(mSavedInstanceState);
     
            // Can go with or without this contentView( I do not really need it ).
            Resources res = getResources();
            setContentView( res.getIdentifier("new_activity", "layout", this.getPackageName()));
          
            //Just for now, I use finish(), but actually startActivityForResult goes here.
            finish();
        }
    }

Ewww, what? A whole new activity just to close it? Well…I want to just hit you in the face with new window…
Okay so, this activity lifecycle goes as ----> onCreate() ->onDestroy()
Now the activity disappears and I am back in the game.

Now how a look at the C# part in Unity:

public class SamplePlugin {
	private static AndroidJavaObject _plugin;

	static SamplePlugin() {
		if( Application.platform != RuntimePlatform.Android )
			return;
		
		// find the plugin instance
		using( AndroidJavaClass pluginClass = new AndroidJavaClass( "com.me.unity.myplugin.SamplePlugin" ) )
			_plugin = pluginClass.CallStatic<AndroidJavaObject>( "GetInstance" );
	}

	public static void StartNewActivity(  ) {
		if( Application.platform != RuntimePlatform.Android )
			return;

		_plugin.Call( "StartNewActivity");
	}
}

And I put these lines in the manifest:

<activity android:name="com.me.unity.myplugin.NewActivity" > 
 </activity>

And now, when I click the big red button in game, the magic happens:::: my new activity is launched
and immediately destroyed( “adb shell dumpsys activity” confirmed that! ).

Here comes the BOOM:

Now … the real part of the problem.
When I am back in my game, I quit the game as soon as possible( using Application.Quit() ).
“Oh, mah game is closed.” - my first thought after that.
Well… I tried launching the game again and the big bad dump hit me in the face:

ActivityManager(498): Displayed com.me.myunitygame/com.unity3d.player.UnityPlayerNativeActivity: +869ms (total +9s448ms)
DEBUG(26059): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
DEBUG(26059): Build fingerprint: 'google/nakasi/grouper:4.4/KRT16S/920375:user/release-keys'
DEBUG(26059): Revision: '0'
DEBUG(26059): pid: 11354, tid: 11443, name: Thread-1060  >>> com.me.myunitygame <<<
DEBUG(26059): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000
DEBUG(26059):     r0 00000000  r1 6abd28d0  r2 00000001  r3 00000000
DEBUG(26059):     r4 00010000  r5 6acd0810  r6 6abd28d0  r7 6b055fbc
DEBUG(26059):     r8 6b153b10  r9 6b055fb4  sl 6d01a9b8  fp 6b153b24
DEBUG(26059):     ip 00000001  sp 6b1539f0  lr 401672c7  pc 6a259b00  cpsr 20000010
DEBUG(26059):     d0  0000001c00000010  d1  0000000000000000
DEBUG(26059):     d2  0000000000000000  d3  0000000000000000
DEBUG(26059):     d4  0000000000000000  d5  00000494e2000000
DEBUG(26059):     d6  4492800044480000  d7  3f8000003f800000
DEBUG(26059):     d8  0000000000000000  d9  0000000000000000
DEBUG(26059):     d10 0000000000000000  d11 0000000000000000
DEBUG(26059):     d12 0000000000000000  d13 0000000000000000
DEBUG(26059):     d14 0000000000000000  d15 0000000000000000
DEBUG(26059):     d16 000000000000001c  d17 223d656d616e206c
DEBUG(26059):     d18 00328c7400316d3c  d19 0034cae40033abac
DEBUG(26059):     d20 0008f9c00008f9c0  d21 0008f9c00008f9c0
DEBUG(26059):     d22 0000000100000001  d23 0000000100000001
DEBUG(26059):     d24 0000002a00000029  d25 0000002c0000002b
DEBUG(26059):     d26 00944026008fc024  d27 009d40280098c027
DEBUG(26059):     d28 0000002900000028  d29 0000002b0000002a
DEBUG(26059):     d30 00a6402a00a1c029  d31 00af402c00aac02b
DEBUG(26059):     scr 80000010
DEBUG(26059): backtrace:
DEBUG(26059):     #00  pc 000b6b00  /data/app-lib/com.me.myunitygame-1/libunity.so
DEBUG(26059):     #01  pc 0027a088  /data/app-lib/com.me.myunitygame-1/libunity.so
DEBUG(26059):     #02  pc 003a26b4  /data/app-lib/com.me.myunitygame-1/libunity.so
DEBUG(26059):     #03  pc 003a3084  /data/app-lib/com.me.myunitygame-1/libunity.so
DEBUG(26059):     #04  pc 003a3210  /data/app-lib/com.me.myunitygame-1/libunity.so
DEBUG(26059):     #05  pc 0001dbcc  /system/lib/libdvm.so (dvmPlatformInvoke+112)
DEBUG(26059):     #06  pc 0004e123  /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+398)
DEBUG(26059):     #07  pc 00026fe0  /system/lib/libdvm.so
DEBUG(26059):     #08  pc 0002dfa0  /system/lib/libdvm.so (dvmMterpStd(Thread*)+76)
DEBUG(26059):     #09  pc 0002b638  /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
DEBUG(26059):     #10  pc 00060581  /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+336)
DEBUG(26059):     #11  pc 000605a5  /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20)
DEBUG(26059):     #12  pc 0005528b  /system/lib/libdvm.so
DEBUG(26059):     #13  pc 0000d228  /system/lib/libc.so (__thread_entry+72)
DEBUG(26059):     #14  pc 0000d3c0  /system/lib/libc.so (pthread_create+240)
DEBUG(26059): stack:
DEBUG(26059):          6b1539b0  00000010  
DEBUG(26059):          6b1539b4  401672c7  /system/lib/libc.so
DEBUG(26059):          6b1539b8  00010000  
DEBUG(26059):          6b1539bc  6abd28d0  
DEBUG(26059):          6b1539c0  6abd28d0  
DEBUG(26059):          6b1539c4  6b055fbc  
DEBUG(26059):          6b1539c8  6b153b10  
DEBUG(26059):          6b1539cc  40163d01  /system/lib/libc.so (memalign+12)
DEBUG(26059):          6b1539d0  6abaeb38  /data/app-lib/com.me.myunitygame-1/libunity.so
DEBUG(26059):          6b1539d4  6a2580d0  /data/app-lib/com.me.myunitygame-1/libunity.so
DEBUG(26059):          6b1539d8  00010000  
DEBUG(26059):          6b1539dc  6a258118  /data/app-lib/com.me.myunitygame-1/libunity.so
DEBUG(26059):          6b1539e0  00010000

And 1 more kilometer of DEBUG log which I am going to paste here…

After that the exceptions come( obviously because the process gets killed, duh ) :

ActivityManager(498):   Force finishing activity com.me.myunitygame/com.unity3d.player.UnityPlayerNativeActivity
InputDispatcher(498): channel '42893930 com.me.myunitygame/com.unity3d.player.UnityPlayerNativeActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
InputDispatcher(498): channel '42893930 com.me.myunitygame/com.unity3d.player.UnityPlayerNativeActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
InputDispatcher(498): channel '428c0080 com.me.myunitygame/com.unity3d.player.UnityPlayerNativeActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
InputDispatcher(498): channel '428c0080 com.me.myunitygame/com.unity3d.player.UnityPlayerNativeActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
Zygote(123): Process 11354 terminated by signal (11)
dalvikvm(498): GC_FOR_ALLOC freed 1007K, 19% free 18269K/22344K, paused 77ms, total 77ms
WindowState(498): WIN DEATH: Window{428d6f08 u0 SurfaceView}
dalvikvm(498): GC_FOR_ALLOC freed 589K, 19% free 18178K/22344K, paused 65ms, total 65ms
InputDispatcher(498): Attempted to unregister already unregistered input channel '42893930 com.me.myunitygame/com.unity3d.player.UnityPlayerNativeActivity (server)'
WindowState(498): WIN DEATH: Window{42893930 u0 com.me.myunitygame/com.unity3d.player.UnityPlayerNativeActivity}
InputDispatcher(498): Attempted to unregister already unregistered input channel '428c0080 com.me.myunitygame/com.unity3d.player.UnityPlayerNativeActivity (server)'
WindowState(498): WIN DEATH: Window{42b55ac0 u0 SurfaceView}
WindowState(498): WIN DEATH: Window{428c0080 u0 com.me.myunitygame/com.unity3d.player.UnityPlayerNativeActivity}
ActivityManager(498): Exception thrown during pause
ActivityManager(498): android.os.DeadObjectException
ActivityManager(498): 	at android.os.BinderProxy.transact(Native Method)
ActivityManager(498): 	at android.app.ApplicationThreadProxy.schedulePauseActivity(ApplicationThreadNative.java:660)
ActivityManager(498): 	at com.android.server.am.ActivityStack.startPausingLocked(ActivityStack.java:755)
ActivityManager(498): 	at com.android.server.am.ActivityStack.finishActivityLocked(ActivityStack.java:2408)
ActivityManager(498): 	at com.android.server.am.ActivityStack.finishTopRunningActivityLocked(ActivityStack.java:2279)
ActivityManager(498): 	at com.android.server.am.ActivityStackSupervisor.finishTopRunningActivityLocked(ActivityStackSupervisor.java:2018)
ActivityManager(498): 	at com.android.server.am.ActivityManagerService.handleAppCrashLocked(ActivityManagerService.java:9389)
ActivityManager(498): 	at com.android.server.am.ActivityManagerService.makeAppCrashingLocked(ActivityManagerService.java:9284)
ActivityManager(498): 	at com.android.server.am.ActivityManagerService.crashApplication(ActivityManagerService.java:9926)
ActivityManager(498): 	at com.android.server.am.ActivityManagerService.handleApplicationCrashInner(ActivityManagerService.java:9478)
ActivityManager(498): 	at com.android.server.am.NativeCrashListener$NativeCrashReporter.run(NativeCrashListener.java:86)
ActivityManager(498): Process com.me.myunitygame (pid 11354) has died.

And one NullPointerException , or two…
So. After the process is killed I can launch my game again.

Remember when I said that I wanted to make my activity transparent? Well, yeah, I just add a theme to my activity in the manifest:

<activity android:name="com.me.unity.myplugin.NewActivity" 
        			  android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"> 
</activity>

or

<activity android:name="com.me.unity.myplugin.NewActivity" 
        			  android:theme="@android:style/Theme.NoDisplay"> 
</activity>

This does the trick.

So…here are some different scenarios :

  • When I launch the native activity, it executes and finishes. Then I am back in my game. If I minimize the game, then open it again( its state is restored ) and THEN I quit it, it quits as it should. No problems occur.

  • When I launch the native activity, it executes and finishes. Then I am back in my game. Sometimes(not always) if I wait a few seconds before I quit it, it quits normally. No problems occur( sometimes ).

  • When I put Theme.NoDisplay on my activity, after it finishes and I am back in the game, I quit the game and the problem I mentioned happens( 100% ).

  • I put Theme.Translucent.NoTitleBar.Fullscreen on my activity. After it finishes, I am back in the game. I wait a few seconds and quit the game. Sometimes the problem occurs, sometimes not. ( 50% ).

  • I put no theme on my activity. After it finishes, I am back in the game. I wait a few seconds( less than when I put Translucent theme), I quit the game and usually there is not problem. If I quit the game too fast, the problem occurs.

  • Setting content view in my activity ( setContentView ) makes the game more likely to quit without problem. But still, the problem occurs sometimes.

  • I tried with BroadcastReceiver from which I launch the new activity → same behaviour.

  • I cannot confirm 100% but if I let my activity go through all of its states when created( not call finish in onCreate ) , the problem does not occur( or may happen but really rarely ).

  • I tried putting a timer in onCreate, which executes finish() on my activity ( through a handler - on the main thread ) when it finishes. I tested it a few times, and when the native activity is closed and I quit the game, there is not problem.

When the problem occurs, I usually execute the “adb shell dump sys activity” in the terminal, and I see that UnityPlayerNativeActivity is in the state: Activities Waiting to Stop.

Soooo I smell there is some background dark magic going on, which somehow keeps the process alive.

So these are the scenarios I can think of ( that I have tested ). There may be 1 or 2 I am missing but I tested tons of different options, and nothing helped at 100%.
To me, this behaviour is pretty much UNKNOWN. So I hope there is somebody who can tell me where I go wrong, or what option can I try to solve the issue.

Oh… and I hope I did not forget to show any important part of the project.

Here comes my apology:

  • Sorry if I misconstructed, misspelled or anything similar with the English language.
  • Sorry for burning your eyes with the long post.
  • I want to apologize to myself for creating a big bald spot on the back of my head.

SIGSEV 11 and memory address 0x00000000 as your case it’s commonly a NullPointer issue.

I would start looking if UnityPlayer.currentActivity returns the current activity Context on your Activity.

Also, if you are using Android layouts and other resources, you need to copy them on Android/Plugins/res folder or similar because the R class is regenerated by Unity when building your game.

Hi.
I am not sure what you mean with " if UnityPlayer.currentActivity returns the current activity Context on your Activity", but when the new activity is started, it is placed in the UnityPlayerNativeActivity ’ s task back stack, which creates the following stack:

Task #NUMBER:
#2 : com.me.myunitygame / com.me.unity.myplugin.NewActivity;
#1 : com.me.myunitygame / com.unity3d.player.UnityPlayerNativeActivity;

This looks good to me. So when I finish the NewActivity, it is properly removed from the back stack. After that the focus goes directly to UnityPlayerNativeActivity, which still looks good to me. When I close the application (depending on one of the scenarios mentioned above ), the problem occurs.
Strange thing is that on some devices( usually with older android OS ) there is NO problem at all. It never occurs.

What does your manifest look like?

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.me.myunitygame" android:theme="@android:style/Theme.NoTitleBar" android:versionName="1.0" android:versionCode="1" android:installLocation="preferExternal">
  <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="false">
    <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" android:screenOrientation="portrait">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
      <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
    </activity>

    <activity android:name="com.me.unity.myplugin.NewActivity" 
		     android:theme="@android:style/Theme.Translucent.NoTitleBar"> 
    </activity>
	
</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"/>
	    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
	    <uses-permission android:name="com.android.vending.BILLING"/>
	    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
	    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

</manifest>

Yeah, that looks ok. Do you mind running a “Development” build and see if you can get some symbols out of the Unity library? And possibly posting the entire logcat so I can see what is leading up to the crash.

Or you could file a proper bug report :wink:

Hi. Sorry for replying so late.

So here are the logs using development build:

First start:

01-13 15:01:01.441: I/ActivityManager(478): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.me.myunitygame/com.unity3d.player.UnityPlayerNativeActivity} from pid 861
01-13 15:01:01.501: I/ActivityManager(478): Start proc com.me.myunitygame for activity com.me.myunitygame/com.unity3d.player.UnityPlayerNativeActivity: pid=18601 uid=10094 gids={50094, 3003, 1015, 1028}
01-13 15:01:01.511: D/dalvikvm(18601): Late-enabling CheckJNI
01-13 15:01:01.581: D/dalvikvm(18601): Trying to load lib /data/app-lib/com.me.myunitygame-2/libmain.so 0x414529b8
01-13 15:01:01.581: D/dalvikvm(18601): Added shared lib /data/app-lib/com.me.myunitygame-2/libmain.so 0x414529b8
01-13 15:01:01.591: I/Unity(18601): gles_mode = 0 (integer)
01-13 15:01:01.591: I/Unity(18601): splash_mode = 0 (integer)
01-13 15:01:01.591: I/Unity(18601): hide_status_bar = True (bool)
01-13 15:01:01.591: I/Unity(18601): useObb = False (bool)
01-13 15:01:01.591: I/Unity(18601): development_player = True (bool)
01-13 15:01:01.631: D/Unity(18601): surfaces: attach glview
01-13 15:01:02.081: I/Unity(18601): onResume
01-13 15:01:02.371: D/Unity(18601): [EGL] Attaching window 0x68ce5998
01-13 15:01:02.411: I/Unity(18601): windowFocusChanged: true
01-13 15:01:02.421: D/Unity(18601): SystemInfo CPU = ARMv7 VFPv3 NEON, Cores = 4, Memory = 974mb
01-13 15:01:02.431: I/ActivityManager(478): Displayed com.me.myunitygame/com.unity3d.player.UnityPlayerNativeActivity: +946ms
01-13 15:01:03.121: D/Unity(18601): [SHA1] 81b2a76aa88bc8178e778a34bcc47e930bc03f31   16599592 bytes ~ lib/armeabi-v7a/libunity.so
01-13 15:01:03.121: D/Unity(18601): Mono path[0] = '/data/app/com.me.myunitygame-2.apk/assets/bin/Data/Managed'
01-13 15:01:03.121: D/Unity(18601): Mono config path = 'assets/bin/Data/Managed'
01-13 15:01:03.121: D/Unity(18601): PlayerConnection initialized from /data/app/com.me.myunitygame-2.apk/assets/bin/Data (debug = 0)
01-13 15:01:03.131: D/Unity(18601): PlayerConnection initialized network socket : 0.0.0.0 55482
01-13 15:01:03.131: D/Unity(18601): PlayerConnection initialized unix socket : Unity-com.me.myunitygame
01-13 15:01:03.131: D/Unity(18601): Multi-casting "[IP] 10.7.3.127 [Port] 55482 [Flags] 2 [Guid] 20878813 [EditorId] 2156900419 [Version] 1048832 [Id] AndroidPlayer(asus_Nexus_7:10.7.3.127) [Debug] 0" to [225.0.0.222:54997]...
01-13 15:01:03.181: W/mono(18601): Symbol file /data/app/com.me.myunitygame-2.apk/assets/bin/Data/Managed/mscorlib.dll.mdb doesn't match image /data/app/com.me.myunitygame-2.apk/assets/bin/Data/Managed/mscorlib.dll
01-13 15:01:03.211: W/mono(18601): Symbol file /data/app/com.me.myunitygame-2.apk/assets/bin/Data/Managed/mscorlib.dll.mdb doesn't match image /data/app/com.me.myunitygame-2.apk/assets/bin/Data/Managed/mscorlib.dll
01-13 15:01:03.241: D/Unity(18601): InitializeMonoFromMain OK (61b1aee0)
01-13 15:01:03.241: D/Unity(18601): PlayerConnection already initialized - listening to [10.7.3.127:55482]
01-13 15:01:03.261: D/Unity(18601): PlayerInitEngineNoGraphics OK
01-13 15:01:03.261: D/Unity(18601): GfxDevice: creating device client; threaded=0
01-13 15:01:03.261: D/libEGL(18601): loaded /system/lib/egl/libEGL_tegra.so
01-13 15:01:03.271: D/libEGL(18601): loaded /system/lib/egl/libGLESv1_CM_tegra.so
01-13 15:01:03.281: D/libEGL(18601): loaded /system/lib/egl/libGLESv2_tegra.so
01-13 15:01:03.291: D/Unity(18601): [EGL] Request: ES2 RGB24 888 24/8
01-13 15:01:03.291: D/Unity(18601): [EGL] Selected: ES2 RGB24 888 16NLZ/8
01-13 15:01:03.301: D/Unity(18601): Renderer: NVIDIA Tegra 3
01-13 15:01:03.301: D/Unity(18601): Vendor:   NVIDIA Corporation
01-13 15:01:03.301: D/Unity(18601): Version:  OpenGL ES 2.0 14.01002
01-13 15:01:03.301: D/Unity(18601): GL_OES_rgb8_rgba8 GL_OES_EGL_sync GL_OES_fbo_render_mipmap GL_NV_depth_nonlinear GL_NV_draw_path GL_NV_texture_npot_2D_mipmap GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_vertex_half_float GL_OES_mapbuffer GL_NV_draw_buffers GL_NV_multiview_draw_buffers GL_EXT_Cg_shader GL_EXT_packed_float GL_OES_texture_half_float GL_EXT_texture_array GL_OES_compressed_ETC1_RGB8_texture GL_EXT_texture_compression_latc GL_NV_texture_compression_latc GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_s3tc GL_NV_texture_compression_s3tc GL_EXT_texture_filter_anisotropic GL_NV_get_tex_image GL_NV_read_buffer GL_NV_shader_framebuffer_fetch GL_NV_copy_image GL_NV_fbo_color_attachments GL_EXT_bgra GL_EXT_texture_format_BGRA8888 GL_EXT_unpack_subimage GL_NV_pack_subimage GL_NV_texture_compression_s3tc_update GL_NV_read_depth GL_NV_read_stencil GL_NV_uniform_buffer_object GL_EXT_robustness GL_OES_standard_derivatives GL_NV_EGL_stream_consumer_external GL_NV_3dvision_settings GL_EXT_debug_marker GL_EXT_debug_label GL_NV_
01-13 15:01:03.301: D/Unity(18601): coverage_sample GL_EXT_occlusion_query_boolean GL_NV_timer_query 
01-13 15:01:03.301: D/Unity(18601): Creating OpenGLES2.0 graphics device
01-13 15:01:03.301: D/Unity(18601): InitializeGfxDevice OK
01-13 15:01:03.301: D/Unity(18601): Initialize engine version: 4.3.0f4 (e01000627d60)
01-13 15:01:03.331: W/libc(18601): pthread_create sched_setscheduler call failed: Operation not permitted
01-13 15:01:03.331: D/Unity(18601): Begin MonoManager ReloadAssembly
01-13 15:01:03.351: D/Unity(18601): Platform assembly: /data/app/com.me.myunitygame-2.apk/assets/bin/Data/Managed/UnityEngine.dll (this message is harmless)
01-13 15:01:03.351: D/Unity(18601): Loading /data/app/com.me.myunitygame-2.apk/assets/bin/Data/Managed/UnityEngine.dll into Unity Child Domain
01-13 15:01:03.411: D/Unity(18601): Platform assembly: /data/app/com.me.myunitygame-2.apk/assets/bin/Data/Managed/Assembly-CSharp.dll (this message is harmless)
01-13 15:01:03.411: D/Unity(18601): Loading /data/app/com.me.myunitygame-2.apk/assets/bin/Data/Managed/Assembly-CSharp.dll into Unity Child Domain
01-13 15:01:03.431: D/Unity(18601): - Completed reload, in  0.103 seconds
01-13 15:01:03.451: D/Unity(18601): PlayerInitEngineGraphics OK
01-13 15:01:03.451: D/Unity(18601): Found 13 native sensors
01-13 15:01:03.451: D/Unity(18601): Sensor :        Accelerometer ( 1) ; 0.039227 / 0.00s ; MPL Accelerometer / Invensense 
01-13 15:01:03.451: D/Unity(18601): Sensor :        Accelerometer ( 1) ; 0.039227 / 0.00s ; MPL Accelerometer / Invensense 
01-13 15:01:03.801: W/SensorService(478): sensor 00000001 already enabled in connection 0x64aa85a0 (ignoring)
01-13 15:01:03.801: D/Unity(18601): Sensor :        Accelerometer ( 1) ; 0.039227 / 0.00s ; MPL Accelerometer / Invensense 
01-13 15:01:06.901: D/dalvikvm(18601): GC_CONCURRENT freed 282K, 6% free 7397K/7828K, paused 3ms+2ms, total 18ms
01-13 15:01:06.921: I/ActivityManager(478): START u0 {cmp=com.me.myunitygame/com.me.unity.myplugin.NewActivity} from pid 18601
01-13 15:01:07.001: D/dalvikvm(478): GC_FOR_ALLOC freed 2229K, 21% free 17750K/22348K, paused 69ms, total 69ms
01-13 15:01:07.501: W/ActivityManager(478): Activity pause timeout for ActivityRecord{41b7d5d0 u0 com.me.myunitygame/com.unity3d.player.UnityPlayerNativeActivity}
01-13 15:01:07.831: I/Unity(18601): onPause
01-13 15:01:07.851: D/Unity(18601): Sensor :        Accelerometer ( 1) ; 0.039227 / 0.00s ; MPL Accelerometer / Invensense 
01-13 15:01:07.871: D/NEW ACTIVITY(18601): New Activity Created...Time to finish it....
01-13 15:01:07.881: I/Unity(18601): windowFocusChanged: false
01-13 15:01:07.881: I/Unity(18601): windowFocusChanged: true
01-13 15:01:07.881: W/InputMethodManagerService(478): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@41b7e8f0 attribute=null, token = android.os.BinderProxy@41a7afb8
01-13 15:01:08.831: I/Unity(18601): onResume
01-13 15:01:08.851: D/Unity(18601): Sensor :        Accelerometer ( 1) ; 0.039227 / 0.00s ; MPL Accelerometer / Invensense 
01-13 15:01:13.081: I/Unity(18601): Quitting application...
01-13 15:01:13.081: I/Unity(18601): UnityEngine.Debug:Internal_Log(Int32, String, Object)
01-13 15:01:13.081: I/Unity(18601): UnityEngine.Debug:Log(Object)
01-13 15:01:13.081: I/Unity(18601): UnityEngine.MonoBehaviour:print(Object)
01-13 15:01:13.081: I/Unity(18601): MainScript:Update() (at /UnityProjects/MyUnityGame/Assets/MainScript.cs:13)
01-13 15:01:13.081: I/Unity(18601):  
01-13 15:01:13.081: I/Unity(18601): (Filename: /UnityProjects/MyUnityGame/Assets/MainScript.cs Line: 13)
01-13 15:01:13.601: W/ActivityManager(478): Activity pause timeout for ActivityRecord{41b7d5d0 u0 com.me.myunitygame/com.unity3d.player.UnityPlayerNativeActivity}
01-13 15:01:14.331: I/Unity(18601): onPause
01-13 15:01:14.521: D/Unity(18601): ASensorManager_destroyEventQueue returned 0
01-13 15:01:14.521: I/Unity(18601): windowFocusChanged: false

Second start after closing app( problematic ) :

01-13 15:02:07.241: I/ActivityManager(478): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.me.myunitygame/com.unity3d.player.UnityPlayerNativeActivity} from pid 861
01-13 15:02:07.321: I/Unity(18601): gles_mode = 0 (integer)
01-13 15:02:07.321: I/Unity(18601): splash_mode = 0 (integer)
01-13 15:02:07.321: I/Unity(18601): hide_status_bar = True (bool)
01-13 15:02:07.321: I/Unity(18601): useObb = False (bool)
01-13 15:02:07.321: I/Unity(18601): development_player = True (bool)
01-13 15:02:07.331: D/Unity(18601): surfaces: attach glview
01-13 15:02:07.821: I/Unity(18601): onResume
01-13 15:02:08.111: D/Unity(18601): [EGL] Attaching window 0x68b3cbf0
01-13 15:02:08.161: I/Unity(18601): windowFocusChanged: true
01-13 15:02:08.161: A/libc(18601): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 18673 (Thread-1322)
01-13 15:02:08.171: I/ActivityManager(478): Displayed com.me.myunitygame/com.unity3d.player.UnityPlayerNativeActivity: +889ms (total +60s671ms)
01-13 15:02:08.271: I/DEBUG(18579): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-13 15:02:08.271: I/DEBUG(18579): Build fingerprint: 'google/nakasi/grouper:4.2.2/JDQ39/573038:user/release-keys'
01-13 15:02:08.271: I/DEBUG(18579): Revision: '0'
01-13 15:02:08.271: I/DEBUG(18579): pid: 18601, tid: 18673, name: Thread-1322  >>> com.me.myunitygame <<<
01-13 15:02:08.271: I/DEBUG(18579): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000
01-13 15:02:08.641: I/DEBUG(18579):     r0 00000000  r1 6aa7ca40  r2 00000001  r3 00000000
01-13 15:02:08.641: I/DEBUG(18579):     r4 00010000  r5 00000000  r6 6aa75814  r7 6aa7ca40
01-13 15:02:08.641: I/DEBUG(18579):     r8 6afdfc78  r9 40bc3fb4  sl 61eb84b0  fp 6afdfc8c
01-13 15:02:08.641: I/DEBUG(18579):     ip 00000000  sp 6afdfb48  lr 4017a64d  pc 69e9db5c  cpsr 20000010
01-13 15:02:08.641: I/DEBUG(18579):     d0  0000008543052000  d1  4496b00043052000
01-13 15:02:08.641: I/DEBUG(18579):     d2  3f00000044480000  d3  3f00000000000000
01-13 15:02:08.641: I/DEBUG(18579):     d4  0000000000000000  d5  3f80000080000000
01-13 15:02:08.641: I/DEBUG(18579):     d6  3f80000044480000  d7  4496a0004496a000
01-13 15:02:08.641: I/DEBUG(18579):     d8  0000000000000000  d9  0000000000000000
01-13 15:02:08.641: I/DEBUG(18579):     d10 0000000000000000  d11 0000000000000000
01-13 15:02:08.641: I/DEBUG(18579):     d12 0000000000000000  d13 0000000000000000
01-13 15:02:08.641: I/DEBUG(18579):     d14 0000000000000000  d15 0000000000000000
01-13 15:02:08.641: I/DEBUG(18579):     d16 000000000000010b  d17 000000000000010b
01-13 15:02:08.641: I/DEBUG(18579):     d18 0000000000000000  d19 0000000000000000
01-13 15:02:08.641: I/DEBUG(18579):     d20 0000000000000000  d21 3ff0000000000000
01-13 15:02:08.641: I/DEBUG(18579):     d22 8000000000000000  d23 0000000000000000
01-13 15:02:08.641: I/DEBUG(18579):     d24 0000000000000000  d25 8000000000000000
01-13 15:02:08.641: I/DEBUG(18579):     d26 3ff0000000000000  d27 0067006700670067
01-13 15:02:08.641: I/DEBUG(18579):     d28 0100010001000100  d29 0100010001000100
01-13 15:02:08.641: I/DEBUG(18579):     d30 0000000100000001  d31 0000000100000001
01-13 15:02:08.641: I/DEBUG(18579):     scr 80000090
01-13 15:02:08.651: I/DEBUG(18579): backtrace:
01-13 15:02:08.651: I/DEBUG(18579):     #00  pc 000b8b5c  /data/app-lib/com.me.myunitygame-2/libunity.so (MemoryManager::ThreadInitialize(unsigned int)+128)
01-13 15:02:08.651: I/DEBUG(18579):     #01  pc 0028745c  /data/app-lib/com.me.myunitygame-2/libunity.so (RuntimeInitialize()+48)
01-13 15:02:08.651: I/DEBUG(18579):     #02  pc 003fe61c  /data/app-lib/com.me.myunitygame-2/libunity.so (UnityInitApplication()+8)
01-13 15:02:08.651: I/DEBUG(18579):     #03  pc 003feebc  /data/app-lib/com.me.myunitygame-2/libunity.so (UnityPlayerLoop()+664)
01-13 15:02:08.651: I/DEBUG(18579):     #04  pc 004039b8  /data/app-lib/com.me.myunitygame-2/libunity.so (nativeRender(_JNIEnv*, _jobject*)+80)
01-13 15:02:08.651: I/DEBUG(18579):     #05  pc 0001e290  /system/lib/libdvm.so (dvmPlatformInvoke+112)
01-13 15:02:08.651: I/DEBUG(18579):     #06  pc 0004d411  /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+396)
01-13 15:02:08.651: I/DEBUG(18579):     #07  pc 000276a0  /system/lib/libdvm.so
01-13 15:02:08.651: I/DEBUG(18579):     #08  pc 0002b57c  /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
01-13 15:02:08.651: I/DEBUG(18579):     #09  pc 0005fc31  /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+272)
01-13 15:02:08.651: I/DEBUG(18579):     #10  pc 0005fc5b  /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20)
01-13 15:02:08.651: I/DEBUG(18579):     #11  pc 000547d7  /system/lib/libdvm.so
01-13 15:02:08.651: I/DEBUG(18579):     #12  pc 0000e3d8  /system/lib/libc.so (__thread_entry+72)
01-13 15:02:08.651: I/DEBUG(18579):     #13  pc 0000dac4  /system/lib/libc.so (pthread_create+160)
01-13 15:02:08.651: I/DEBUG(18579): stack:
01-13 15:02:08.651: I/DEBUG(18579):          6afdfb08  61f35018  
01-13 15:02:08.651: I/DEBUG(18579):          6afdfb0c  4017a64d  /system/lib/libc.so
01-13 15:02:08.651: I/DEBUG(18579):          6afdfb10  00010000  
01-13 15:02:08.651: I/DEBUG(18579):          6afdfb14  6aa7ca40  
01-13 15:02:08.651: I/DEBUG(18579):          6afdfb18  6aa75814  /data/app-lib/com.me.myunitygame-2/libunity.so
01-13 15:02:08.651: I/DEBUG(18579):          6afdfb1c  6aa7ca40  
01-13 15:02:08.651: I/DEBUG(18579):          6afdfb20  6afdfc78  
01-13 15:02:08.651: I/DEBUG(18579):          6afdfb24  40175f51  /system/lib/libc.so (memalign+12)
01-13 15:02:08.651: I/DEBUG(18579):          6afdfb28  6aa53598  /data/app-lib/com.me.myunitygame-2/libunity.so
01-13 15:02:08.651: I/DEBUG(18579):          6afdfb2c  69e9c52c  /data/app-lib/com.me.myunitygame-2/libunity.so (MemoryManager::LowLevelAllocate(unsigned int)+20)
01-13 15:02:08.651: I/DEBUG(18579):          6afdfb30  00010000  
01-13 15:02:08.651: I/DEBUG(18579):          6afdfb34  69ea0330  /data/app-lib/com.me.myunitygame-2/libunity.so (StackAllocator::StackAllocator(int, char const*)+60)
01-13 15:02:08.651: I/DEBUG(18579):          6afdfb38  00010000  
01-13 15:02:08.651: I/DEBUG(18579):          6afdfb3c  00000000  
01-13 15:02:08.651: I/DEBUG(18579):          6afdfb40  df0027ad  
01-13 15:02:08.651: I/DEBUG(18579):          6afdfb44  00000000  
01-13 15:02:08.651: I/DEBUG(18579):     #00  6afdfb48  6a899854  /data/app-lib/com.me.myunitygame-2/libunity.so
01-13 15:02:08.651: I/DEBUG(18579):          6afdfb4c  000002b9  
01-13 15:02:08.651: I/DEBUG(18579):          6afdfb50  00000000  
01-13 15:02:08.651: I/DEBUG(18579):          6afdfb54  6ab7835c  
01-13 15:02:08.651: I/DEBUG(18579):          6afdfb58  000013ac  
01-13 15:02:08.651: I/DEBUG(18579):          6afdfb5c  00000007  
01-13 15:02:08.651: I/DEBUG(18579):          6afdfb60  40bc3fbc  
01-13 15:02:08.661: I/DEBUG(18579):          6afdfb64  6a06c460  /data/app-lib/com.me.myunitygame-2/libunity.so (RuntimeInitialize()+52)
01-13 15:02:08.661: I/DEBUG(18579):     #01  6afdfb68  6aa699fc  /data/app-lib/com.me.myunitygame-2/libunity.so
01-13 15:02:08.661: I/DEBUG(18579):          6afdfb6c  6a1e3620  /data/app-lib/com.me.myunitygame-2/libunity.so (UnityInitApplication()+12)
01-13 15:02:08.661: I/DEBUG(18579):     #02  6afdfb70  00000000  
01-13 15:02:08.661: I/DEBUG(18579):          6afdfb74  00000000  
01-13 15:02:08.661: I/DEBUG(18579):          6afdfb78  00000000  
01-13 15:02:08.661: I/DEBUG(18579):          6afdfb7c  00000000  
01-13 15:02:08.661: I/DEBUG(18579):          6afdfb80  00000000  
01-13 15:02:08.661: I/DEBUG(18579):          6afdfb84  00000000  
01-13 15:02:08.661: I/DEBUG(18579):          6afdfb88  00000000  
01-13 15:02:08.661: I/DEBUG(18579):          6afdfb8c  00000000  
01-13 15:02:08.661: I/DEBUG(18579):          6afdfb90  00000000  
01-13 15:02:08.661: I/DEBUG(18579):          6afdfb94  00000000  
01-13 15:02:08.661: I/DEBUG(18579):          6afdfb98  00000000  
01-13 15:02:08.661: I/DEBUG(18579):          6afdfb9c  00000000  
01-13 15:02:08.661: I/DEBUG(18579):          6afdfba0  00000000  
01-13 15:02:08.661: I/DEBUG(18579):          6afdfba4  00000000  
01-13 15:02:08.661: I/DEBUG(18579):          6afdfba8  00000007  
01-13 15:02:08.661: I/DEBUG(18579):          6afdfbac  00000006  
01-13 15:02:08.661: I/DEBUG(18579):          ........  ........
01-13 15:02:08.661: I/DEBUG(18579): memory near r1:
01-13 15:02:08.661: I/DEBUG(18579):     6aa7ca20 00000058 6aa76500 00000008 00000059  
01-13 15:02:08.661: I/DEBUG(18579):     6aa7ca30 00000000 00000000 0000002c 00000000  
01-13 15:02:08.661: I/DEBUG(18579):     6aa7ca40 6aa53598 6a899754 00000022 00000000  
01-13 15:02:08.661: I/DEBUG(18579):     6aa7ca50 00010000 00000000 00000000 00000000  
01-13 15:02:08.661: I/DEBUG(18579):     6aa7ca60 61f35030 00010000 00000000 6aa76500  
01-13 15:02:08.661: I/DEBUG(18579):     6aa7ca70 00000000 00000000 6aa7ca1c 0000002c  
01-13 15:02:08.661: I/DEBUG(18579):     6aa7ca80 6aa76500 6aa76500 0000000c 00000011  
01-13 15:02:08.661: I/DEBUG(18579):     6aa7ca90 00000000 00000000 00000008 00000000  
01-13 15:02:08.661: I/DEBUG(18579):     6aa7caa0 1d30023a 00000001 6aa7ca78 0000002c  
01-13 15:02:08.661: I/DEBUG(18579):     6aa7cab0 6aa76500 6aa76500 0000000c 00000011  
01-13 15:02:08.661: I/DEBUG(18579):     6aa7cac0 00000000 00000000 00000008 00000000  
01-13 15:02:08.661: I/DEBUG(18579):     6aa7cad0 1d20023e 00000001 6aa7caa8 0000002c  
01-13 15:02:08.661: I/DEBUG(18579):     6aa7cae0 6aa76500 6aa76500 0000000c 00000011  
01-13 15:02:08.661: I/DEBUG(18579):     6aa7caf0 00000000 00000000 00000008 00000000  
01-13 15:02:08.661: I/DEBUG(18579):     6aa7cb00 1d200246 00000001 6aa7cad8 0000002c  
01-13 15:02:08.661: I/DEBUG(18579):     6aa7cb10 6aa7b704 6aa76500 0000000c 00000011  
01-13 15:02:08.661: I/DEBUG(18579): memory near r4:
01-13 15:02:08.661: I/DEBUG(18579):     0000ffe0 ffffffff ffffffff ffffffff ffffffff  
01-13 15:02:08.661: I/DEBUG(18579):     0000fff0 ffffffff ffffffff ffffffff ffffffff  
01-13 15:02:08.661: I/DEBUG(18579):     00010000 ffffffff ffffffff ffffffff ffffffff  
01-13 15:02:08.661: I/DEBUG(18579):     00010010 ffffffff ffffffff ffffffff ffffffff  
01-13 15:02:08.661: I/DEBUG(18579):     00010020 ffffffff ffffffff ffffffff ffffffff  
01-13 15:02:08.661: I/DEBUG(18579):     00010030 ffffffff ffffffff ffffffff ffffffff  
01-13 15:02:08.661: I/DEBUG(18579):     00010040 ffffffff ffffffff ffffffff ffffffff  
01-13 15:02:08.661: I/DEBUG(18579):     00010050 ffffffff ffffffff ffffffff ffffffff  
01-13 15:02:08.661: I/DEBUG(18579):     00010060 ffffffff ffffffff ffffffff ffffffff  
01-13 15:02:08.661: I/DEBUG(18579):     00010070 ffffffff ffffffff ffffffff ffffffff  
01-13 15:02:08.661: I/DEBUG(18579):     00010080 ffffffff ffffffff ffffffff ffffffff  
01-13 15:02:08.661: I/DEBUG(18579):     00010090 ffffffff ffffffff ffffffff ffffffff  
01-13 15:02:08.661: I/DEBUG(18579):     000100a0 ffffffff ffffffff ffffffff ffffffff  
01-13 15:02:08.661: I/DEBUG(18579):     000100b0 ffffffff ffffffff ffffffff ffffffff  
01-13 15:02:08.661: I/DEBUG(18579):     000100c0 ffffffff ffffffff ffffffff ffffffff  
01-13 15:02:08.671: I/DEBUG(18579):     000100d0 ffffffff ffffffff ffffffff ffffffff  
01-13 15:02:08.671: I/DEBUG(18579): memory near r6:
01-13 15:02:08.671: I/DEBUG(18579):     6aa757f4 00000000 6aa75814 00000000 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     6aa75804 00000000 00004000 61fd28a0 001cf400  
01-13 15:02:08.671: I/DEBUG(18579):     6aa75814 00000000 6aa75ec4 00000000 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     6aa75824 00000000 00000000 00000000 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     6aa75834 00000000 00000000 00000000 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     6aa75844 00000000 00000000 00000000 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     6aa75854 00000000 00000000 00000000 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     6aa75864 00000000 00000000 00000000 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     6aa75874 00000000 00000000 00000000 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     6aa75884 00000000 00000000 00000000 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     6aa75894 00000000 00000000 00000000 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     6aa758a4 00000000 00000000 00000000 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     6aa758b4 00000000 00000000 00000000 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     6aa758c4 00000000 00000000 00000000 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     6aa758d4 00000000 00000000 00000000 00000100  
01-13 15:02:08.671: I/DEBUG(18579):     6aa758e4 00000000 6aa75ec4 00000000 00000000  
01-13 15:02:08.671: I/DEBUG(18579): memory near r7:
01-13 15:02:08.671: I/DEBUG(18579):     6aa7ca20 00000058 6aa76500 00000008 00000059  
01-13 15:02:08.671: I/DEBUG(18579):     6aa7ca30 00000000 00000000 0000002c 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     6aa7ca40 6aa53598 6a899754 00000022 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     6aa7ca50 00010000 00000000 00000000 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     6aa7ca60 61f35030 00010000 00000000 6aa76500  
01-13 15:02:08.671: I/DEBUG(18579):     6aa7ca70 00000000 00000000 6aa7ca1c 0000002c  
01-13 15:02:08.671: I/DEBUG(18579):     6aa7ca80 6aa76500 6aa76500 0000000c 00000011  
01-13 15:02:08.671: I/DEBUG(18579):     6aa7ca90 00000000 00000000 00000008 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     6aa7caa0 1d30023a 00000001 6aa7ca78 0000002c  
01-13 15:02:08.671: I/DEBUG(18579):     6aa7cab0 6aa76500 6aa76500 0000000c 00000011  
01-13 15:02:08.671: I/DEBUG(18579):     6aa7cac0 00000000 00000000 00000008 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     6aa7cad0 1d20023e 00000001 6aa7caa8 0000002c  
01-13 15:02:08.671: I/DEBUG(18579):     6aa7cae0 6aa76500 6aa76500 0000000c 00000011  
01-13 15:02:08.671: I/DEBUG(18579):     6aa7caf0 00000000 00000000 00000008 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     6aa7cb00 1d200246 00000001 6aa7cad8 0000002c  
01-13 15:02:08.671: I/DEBUG(18579):     6aa7cb10 6aa7b704 6aa76500 0000000c 00000011  
01-13 15:02:08.671: I/DEBUG(18579): memory near r8:
01-13 15:02:08.671: I/DEBUG(18579):     6afdfc58 40bc3fbc 6afdfc78 61eb84b0 6a1e89bc  
01-13 15:02:08.671: I/DEBUG(18579):     6afdfc68 61eb84a0 6aa780f0 624acab8 40826294  
01-13 15:02:08.671: I/DEBUG(18579):     6afdfc78 40bc3fb0 00000001 4147b1b8 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     6afdfc88 00000000 40855415 40bc3fb0 59403e51  
01-13 15:02:08.671: I/DEBUG(18579):     6afdfc98 6a1e8968 61eb84b0 00000000 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     6afdfca8 00000000 401b4228 00000000 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     6afdfcb8 00000000 00000000 00000000 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     6afdfcc8 00000000 00000000 00000000 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     6afdfcd8 c0000000 00000020 00000020 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     6afdfce8 65992ce0 4017a3c3 00000000 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     6afdfcf8 00000000 00000000 00000000 00000020  
01-13 15:02:08.671: I/DEBUG(18579):     6afdfd08 61eb8830 00000002 00000000 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     6afdfd18 61eb8830 00000000 00000000 4017742c  
01-13 15:02:08.671: I/DEBUG(18579):     6afdfd28 00000000 ce0c9c72 61eb8840 61eb8830  
01-13 15:02:08.671: I/DEBUG(18579):     6afdfd38 00000000 61eb84a0 65992cc0 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     6afdfd48 61eb8830 00000000 61eb84a0 4085a125  
01-13 15:02:08.671: I/DEBUG(18579): memory near r9:
01-13 15:02:08.671: I/DEBUG(18579):     40bc3f94 593fc538 6227d810 40bc3fc8 593fb7b8  
01-13 15:02:08.671: I/DEBUG(18579):     40bc3fa4 624acab8 00000000 00000000 1d500001  
01-13 15:02:08.671: I/DEBUG(18579):     40bc3fb4 40bc3fe4 593fae22 624ac188 593fb7b8  
01-13 15:02:08.671: I/DEBUG(18579):     40bc3fc4 00000000 00000000 4147b1b8 40bc4000  
01-13 15:02:08.671: I/DEBUG(18579):     40bc3fd4 00000000 624aebc8 593fae22 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     40bc3fe4 4147b1b8 4147b5a8 00000000 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     40bc3ff4 00000000 00000000 00000000 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     40bc4004 00002219 40bc4000 40bc4000 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     40bc4014 00000000 59a6bc18 0000000a 00000044  
01-13 15:02:08.671: I/DEBUG(18579):     40bc4024 00000000 00000000 00000000 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     40bc4034 00000000 00000000 00000000 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     40bc4044 00000000 00000000 00000000 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     40bc4054 00000000 00000000 00000000 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     40bc4064 00000000 00000000 00000000 00000000  
01-13 15:02:08.671: I/DEBUG(18579):     40bc4074 00000000 00000078 0000009a 00000084  
01-13 15:02:08.671: I/DEBUG(18579):     40bc4084 00000000 00000000 00000000 00000000  
01-13 15:02:08.671: I/DEBUG(18579): memory near sl:
01-13 15:02:08.681: I/DEBUG(18579):     61eb8490 00000001 00000000 00000000 00000453  
01-13 15:02:08.681: I/DEBUG(18579):     61eb84a0 593fadd8 40bc3fb0 624ac188 40041000  
01-13 15:02:08.681: I/DEBUG(18579):     61eb84b0 00000000 00000000 6afdfda0 00000000  
01-13 15:02:08.681: I/DEBUG(18579):     61eb84c0 6afdfdd4 0000000e 00000000 40826400  
01-13 15:02:08.681: I/DEBUG(18579):     61eb84d0 00000000 00000000 61366f70 40bc0300  
01-13 15:02:08.681: I/DEBUG(18579):     61eb84e0 00000000 00000000 00000001 00004000  
01-13 15:02:08.681: I/DEBUG(18579):     61eb84f0 00000000 61eb88f0 40826400 4082b2c0  
01-13 15:02:08.681: I/DEBUG(18579):     61eb8500 00000000 4082f3bc 4082f430 4082f2e0  
01-13 15:02:08.681: I/DEBUG(18579):     61eb8510 4082f300 4082f35c 00000000 00000000  
01-13 15:02:08.681: I/DEBUG(18579):     61eb8520 68a7d338 00000028 00000000 00000000  
01-13 15:02:08.681: I/DEBUG(18579):     61eb8530 00000000 00000000 00002000 408b68d4  
01-13 15:02:08.681: I/DEBUG(18579):     61eb8540 00000000 00000000 00000001 63990fe8  
01-13 15:02:08.681: I/DEBUG(18579):     61eb8550 00000001 00000040 00000200 00000000  
01-13 15:02:08.681: I/DEBUG(18579):     61eb8560 00000000 00000000 00000000 00000000  
01-13 15:02:08.681: I/DEBUG(18579):     61eb8570 00000000 00000000 00000000 00000000  
01-13 15:02:08.681: I/DEBUG(18579):     61eb8580 00000000 00000000 00000000 00000000  
01-13 15:02:08.681: I/DEBUG(18579): memory near fp:
01-13 15:02:08.681: I/DEBUG(18579):     6afdfc6c 6aa780f0 624acab8 40826294 40bc3fb0  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfc7c 00000001 4147b1b8 00000000 00000000  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfc8c 40855415 40bc3fb0 59403e51 6a1e8968  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfc9c 61eb84b0 00000000 00000000 00000000  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfcac 401b4228 00000000 00000000 00000000  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfcbc 00000000 00000000 00000000 00000000  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfccc 00000000 00000000 00000000 c0000000  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfcdc 00000020 00000020 00000000 65992ce0  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfcec 4017a3c3 00000000 00000000 00000000  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfcfc 00000000 00000000 00000020 61eb8830  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfd0c 00000002 00000000 00000000 61eb8830  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfd1c 00000000 00000000 4017742c 00000000  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfd2c ce0c9c72 61eb8840 61eb8830 00000000  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfd3c 61eb84a0 65992cc0 00000000 61eb8830  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfd4c 00000000 61eb84a0 4085a125 61eb84b0  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfd5c 40bc3f34 620df800 00000001 620df800  
01-13 15:02:08.681: I/DEBUG(18579): memory near sp:
01-13 15:02:08.681: I/DEBUG(18579):     6afdfb28 6aa53598 69e9c52c 00010000 69ea0330  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfb38 00010000 00000000 df0027ad 00000000  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfb48 6a899854 000002b9 00000000 6ab7835c  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfb58 000013ac 00000007 40bc3fbc 6a06c460  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfb68 6aa699fc 6a1e3620 00000000 00000000  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfb78 00000000 00000000 00000000 00000000  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfb88 00000000 00000000 00000000 00000000  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfb98 00000000 00000000 00000000 00000000  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfba8 00000007 00000006 6aa780d4 6aa76500  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfbb8 6aa75ec4 69e9f1dc 6aa75ec4 6aa780f0  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfbc8 6aa75ec4 69e9f388 00000000 00000000  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfbd8 00000000 00000010 6aa75814 6ab785a8  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfbe8 6aa75ec4 6a0e612c 00000010 6aa699fc  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfbf8 000013ac 00000007 40bc3fbc 6afdfc78  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfc08 40bc3fb4 61eb84b0 6afdfc8c 6a1e3ec0  
01-13 15:02:08.681: I/DEBUG(18579):     6afdfc18 40bc3f34 61eb84b0 00000016 00000019  
01-13 15:02:08.681: I/DEBUG(18579): code around pc:
01-13 15:02:08.681: I/DEBUG(18579):     69e9db3c 11a04005 e1a01004 e08f2002 e1a07000  
01-13 15:02:08.681: I/DEBUG(18579):     69e9db4c eb0009e8 e5963000 e1a01007 e1a00003  
01-13 15:02:08.681: I/DEBUG(18579):     69e9db5c e5933000 e1a0e00f e593f048 e28dd00c  
01-13 15:02:08.681: I/DEBUG(18579):     69e9db6c e8bd80f0 e5d630cd e3530000 1affffe1  
01-13 15:02:08.681: I/DEBUG(18579):     69e9db7c e1a00006 e3a04802 ebfffa79 eaffffde  
01-13 15:02:08.681: I/DEBUG(18579):     69e9db8c 00bccfbc 00bccec0 009fbd2c 009fbc08  
01-13 15:02:08.681: I/DEBUG(18579):     69e9db9c e92d4010 ebfffaf8 e3a01000 e8bd4010  
01-13 15:02:08.681: I/DEBUG(18579):     69e9dbac eaffffca e92d4010 e24dd010 e1a04000  
01-13 15:02:08.681: I/DEBUG(18579):     69e9dbbc ebfffaf1 e59f3028 e1a01004 e59fc024  
01-13 15:02:08.681: I/DEBUG(18579):     69e9dbcc e3a02010 e79f3003 e3a0e000 e08fc00c  
01-13 15:02:08.681: I/DEBUG(18579):     69e9dbdc e98d5000 e58de000 ebfffca5 e28dd010  
01-13 15:02:08.681: I/DEBUG(18579):     69e9dbec e8bd8010 00bcc968 009fbd40 e92d4010  
01-13 15:02:08.681: I/DEBUG(18579):     69e9dbfc e24dd010 e1a04000 ebfffadf e59f3028  
01-13 15:02:08.681: I/DEBUG(18579):     69e9dc0c e1a01004 e59fc024 e3a02010 e79f3003  
01-13 15:02:08.681: I/DEBUG(18579):     69e9dc1c e3a0e000 e08fc00c e98d5000 e58de000  
01-13 15:02:08.691: I/DEBUG(18579):     69e9dc2c ebfffc93 e28dd010 e8bd8010 00bcc920  
01-13 15:02:08.691: I/DEBUG(18579): code around lr:
01-13 15:02:08.691: I/DEBUG(18579):     4017a62c 4478480c fe82f7fd f105480b 44780808  
01-13 15:02:08.691: I/DEBUG(18579):     4017a63c 21bcf8d0 d5060792 70e0f500 eb0ef7fc  
01-13 15:02:08.691: I/DEBUG(18579):     4017a64c f04fe001 46400800 81f0e8bd 000396d8  
01-13 15:02:08.691: I/DEBUG(18579):     4017a65c 0003963e 000395fa 000395ee 4ff7e92d  
01-13 15:02:08.691: I/DEBUG(18579):     4017a66c 4b5c461d 468a4604 447b4693 b90b681b  
01-13 15:02:08.691: I/DEBUG(18579):     4017a67c f984f7fe 2200b115 e0a6b97c 4620b92c  
01-13 15:02:08.691: I/DEBUG(18579):     4017a68c e8bdb003 f7fe4ff0 00a0bc7d 320b4602  
01-13 15:02:08.691: I/DEBUG(18579):     4017a69c f022280a bf980207 f01b2210 bf040301  
01-13 15:02:08.691: I/DEBUG(18579):     4017a6ac 461e4651 f8dad017 290a1000 f101bf86  
01-13 15:02:08.691: I/DEBUG(18579):     4017a6bc f029090b f04f0907 fb040910 e00ef609  
01-13 15:02:08.691: I/DEBUG(18579):     4017a6cc 0b04f851 d903280a f020300b e0000007  
01-13 15:02:08.691: I/DEBUG(18579):     4017a6dc 18362010 42a33301 f04fd1f2 4f3e0900  
01-13 15:02:08.691: I/DEBUG(18579):     4017a6ec 19981f13 f8d7447f f02881bc f8c70101  
01-13 15:02:08.691: I/DEBUG(18579):     4017a6fc 920011bc fc46f7fe 0f01f018 46039a00  
01-13 15:02:08.691: I/DEBUG(18579):     4017a70c f8d7bf1e f04001bc f8c70001 2b0001bc  
01-13 15:02:08.691: I/DEBUG(18579):     4017a71c 4832d058 f8d04478 078911bc f500d509  
01-13 15:02:08.811: I/BootReceiver(478): Copying /data/tombstones/tombstone_05 to DropBox (SYSTEM_TOMBSTONE)
01-13 15:02:08.851: W/InputDispatcher(478): channel '41a7de20 com.me.myunitygame/com.unity3d.player.UnityPlayerNativeActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
01-13 15:02:08.851: E/InputDispatcher(478): channel '41a7de20 com.me.myunitygame/com.unity3d.player.UnityPlayerNativeActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
01-13 15:02:08.871: W/InputDispatcher(478): channel '419b2398 com.me.myunitygame/com.unity3d.player.UnityPlayerNativeActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
01-13 15:02:08.871: E/InputDispatcher(478): channel '419b2398 com.me.myunitygame/com.unity3d.player.UnityPlayerNativeActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
01-13 15:02:08.891: D/Zygote(126): Process 18601 terminated by signal (11)
01-13 15:02:08.921: D/dalvikvm(478): GC_FOR_ALLOC freed 1796K, 19% free 18301K/22348K, paused 91ms, total 93ms
01-13 15:02:08.921: W/InputDispatcher(478): Attempted to unregister already unregistered input channel '419b2398 com.me.myunitygame/com.unity3d.player.UnityPlayerNativeActivity (server)'
01-13 15:02:08.921: I/WindowState(478): WIN DEATH: Window{419b2398 u0 com.me.myunitygame/com.unity3d.player.UnityPlayerNativeActivity}
01-13 15:02:08.921: I/ActivityManager(478): Process com.me.myunitygame (pid 18601) has died.
01-13 15:02:08.921: W/WindowManager(478): Force-removing child win Window{419bf288 u0 SurfaceView} from container Window{419b2398 u0 com.me.myunitygame/com.unity3d.player.UnityPlayerNativeActivity}
01-13 15:02:08.921: W/ActivityManager(478): Force removing ActivityRecord{4187b388 u0 com.me.myunitygame/com.unity3d.player.UnityPlayerNativeActivity}: app died, no saved state
01-13 15:02:08.941: W/WindowManager(478): Failed looking up window
01-13 15:02:08.941: W/WindowManager(478): java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@41f51718 does not exist
01-13 15:02:08.941: W/WindowManager(478): 	at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8102)
01-13 15:02:08.941: W/WindowManager(478): 	at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8093)
01-13 15:02:08.941: W/WindowManager(478): 	at com.android.server.wm.WindowState$DeathRecipient.binderDied(WindowState.java:932)
01-13 15:02:08.941: W/WindowManager(478): 	at android.os.BinderProxy.sendDeathNotice(Binder.java:433)
01-13 15:02:08.941: W/WindowManager(478): 	at dalvik.system.NativeStart.run(Native Method)
01-13 15:02:08.941: I/WindowState(478): WIN DEATH: null
01-13 15:02:08.941: I/WindowState(478): WIN DEATH: Window{41b00a70 u0 SurfaceView}
01-13 15:02:08.941: W/InputDispatcher(478): Attempted to unregister already unregistered input channel '41a7de20 com.me.myunitygame/com.unity3d.player.UnityPlayerNativeActivity (server)'
01-13 15:02:08.941: I/WindowState(478): WIN DEATH: Window{41a7de20 u0 com.me.myunitygame/com.unity3d.player.UnityPlayerNativeActivity}
01-13 15:02:08.991: W/InputMethodManagerService(478): Got RemoteException sending setActive(false) notification to pid 18601 uid 10094

Something is definitely wrong here. First of all the reason it crashes is that it is trying to create two instances of unity within the same process - that will never work. The activity attribute android:launchMode=“singleTask” should ensure there is only one Unity activity active within a process. The other option would be if the first activity actually gets destroyed without calling UnityPlayer.quit(). If that happens none of the native resources will be released.

I think you need to file a bug report and attach your project for me to be able to figure out exactly what is going on.

I can confirm that the player is not releasing the native resources. When I close the app, no “Unregistering JNI method…” occurs( as it usually does when app is closing without problems).

However, I will file a bug report asap. Thank you for your time.

hi,guys.I met the same problem today…so,if the problem got resolved ? Thank you so much :slight_smile:

i have same too, is there any solution ?

@Kukuruz we had run into a (perhaps?) similar issue, where if the player will close the game and then launch it immediately back again, the game would crash on startup.

I even remember opening a bug for it (case 667260).

The issue is that Unity is dumping some resources (cleaning up) when you close the game, but it’s not really closed just yet. When you launch it at that point again, it crashes.

There was never a fix from Unity for our case, so we just had to work around it by not calling Application.Quit(). i can’t recall the exact workaround we pulled but i’ll have to look it up if you’re interested.