Search Unity

[CRASH]es when Quitting the app (Application.Quit()) since 2018.4.20f1

Discussion in 'Android' started by Rutger, Apr 15, 2020.

  1. Rutger

    Rutger

    Joined:
    Sep 17, 2013
    Posts:
    34
    In our latest build of our app we have started to see this too.
    • Built using Unity 2018.4.20f1
    • Happens when the user quits the app (Application.Quit)
    • Several crashes reported:
      • No implementation found for boolean com.unity3d.player.UnityPlayer.nativeInjectEvent(android.view.InputEvent) (tried Java_com_unity3d_player_UnityPlayer_nativeInjectEvent and Java_com_unity3d_player_UnityPlayer_nativeInjectEvent__Landroid_view_InputEvent_2)
        • is what is being reported most often as well / affecting most users
    • We don't use Google Play Games, as was reported to be a likely cause for the above crash here.
    • We have several other similar issues also happening when quitting. All new issues since the latest build (using the mentioned Unity version)
      • Native method not found: com.unity3d.player.UnityPlayer.nativeRecreateGfxState:(ILandroid/view/Surface;)V
      • No implementation found for void com.unity3d.player.UnityPlayer.nativeFocusChanged(boolean) (tried Java_com_unity3d_player_UnityPlayer_nativeFocusChanged and Java_com_unity3d_player_UnityPlayer_nativeFocusChanged__Z)
      • No implementation found for void com.unity3d.player.UnityPlayer.initJni(android.content.Context) (tried Java_com_unity3d_player_UnityPlayer_initJni and Java_com_unity3d_player_UnityPlayer_initJni__Landroid_content_Context_2)

      • These logs are from Firebase. More complete logs below.
    • Although all the crashes happen when quitting. We are unable to reproduce the issue on our own devices.
    The more complete logs:
    Code (JS):
    1. Caused by java.lang.UnsatisfiedLinkError: No implementation found for void com.unity3d.player.UnityPlayer.initJni(android.content.Context) (tried Java_com_unity3d_player_UnityPlayer_initJni and Java_com_unity3d_player_UnityPlayer_initJni__Landroid_content_Context_2)
    2.        at com.unity3d.player.UnityPlayer.initJni()
    3.        at com.unity3d.player.UnityPlayer.<init>(:172)
    4.        at com.unity3d.player.UnityPlayerActivity.onCreate(:30)
    5.        at android.app.Activity.performCreate(Activity.java:7227)
    6.        at android.app.Activity.performCreate(Activity.java:7218)
    7.        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
    8.        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2941)
    9.        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3066)
    10.        at android.app.ActivityThread.-wrap11()
    11.        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1764)
    12.        at android.os.Handler.dispatchMessage(Handler.java:106)
    13.        at android.os.Looper.loop(Looper.java:202)
    14.        at android.app.ActivityThread.main(ActivityThread.java:6962)
    15.        at java.lang.reflect.Method.invoke(Method.java)
    16.        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:528)
    17.        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:888)
    18.  
    Code (JS):
    1. Caused by java.lang.UnsatisfiedLinkError: No implementation found for void com.unity3d.player.UnityPlayer.nativeFocusChanged(boolean) (tried Java_com_unity3d_player_UnityPlayer_nativeFocusChanged and Java_com_unity3d_player_UnityPlayer_nativeFocusChanged__Z)
    2.        at com.unity3d.player.UnityPlayer.nativeFocusChanged()
    3.        at com.unity3d.player.UnityPlayer.a()
    4.        at com.unity3d.player.UnityPlayer$e$1.handleMessage()
    5.        at android.os.Handler.dispatchMessage(Handler.java:98)
    6.        at android.os.Looper.loop(Looper.java:148)
    7.        at com.unity3d.player.UnityPlayer$e.run()
    8.  
    Code (JS):
    1.  
    2. Caused by java.lang.UnsatisfiedLinkError: No implementation found for void com.unity3d.player.UnityPlayer.initJni(android.content.Context) (tried Java_com_unity3d_player_UnityPlayer_initJni and Java_com_unity3d_player_UnityPlayer_initJni__Landroid_content_Context_2)
    3.        at com.unity3d.player.UnityPlayer.initJni()
    4.        at com.unity3d.player.UnityPlayer.<init>(:172)
    5.        at com.unity3d.player.UnityPlayerActivity.onCreate(:30)
    6.        at android.app.Activity.performCreate(Activity.java:7227)
    7.        at android.app.Activity.performCreate(Activity.java:7218)
    8.        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
    9.        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2941)
    10.        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3066)
    11.        at android.app.ActivityThread.-wrap11()
    12.        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1764)
    13.        at android.os.Handler.dispatchMessage(Handler.java:106)
    14.        at android.os.Looper.loop(Looper.java:202)
    15.        at android.app.ActivityThread.main(ActivityThread.java:6962)
    16.        at java.lang.reflect.Method.invoke(Method.java)
    17.        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:528)
    18.        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:888)
    19.  
     
  2. onur-gg

    onur-gg

    Joined:
    Dec 14, 2015
    Posts:
    12
    I recently created an bug report with repro for this problem. The issue is If any touch input is received after triggering Application.Quit() (just spam quit button), the app throws this and several similar UnsatisfiedLinkError.

    Case Id: 1238096
     
  3. Rutger

    Rutger

    Joined:
    Sep 17, 2013
    Posts:
    34
    onur-gg likes this.
  4. Rutger

    Rutger

    Joined:
    Sep 17, 2013
    Posts:
    34
    This morning woke up to another report about a crash happening on application quit:
    java.lang.UnsatisfiedLinkError: No implementation found for void com.unity3d.player.UnityPlayer.nativeDone()


    Code (JS):
    1. java.lang.UnsatisfiedLinkError: No implementation found for void com.unity3d.player.UnityPlayer.nativeDone() (tried Java_com_unity3d_player_UnityPlayer_nativeDone and Java_com_unity3d_player_UnityPlayer_nativeDone__)
    2.        at com.unity3d.player.UnityPlayer.nativeDone()
    3.        at com.unity3d.player.UnityPlayer.g()
    4.        at com.unity3d.player.UnityPlayer.k()
    5.        at com.unity3d.player.UnityPlayer$21.run()
    6.        at android.os.Handler.handleCallback(Handler.java:739)
    7.        at android.os.Handler.dispatchMessage(Handler.java:95)
    8.        at android.os.Looper.loop(Looper.java:148)
    9.        at com.unity3d.player.UnityPlayer$e.run()
     
  5. onur-gg

    onur-gg

    Joined:
    Dec 14, 2015
    Posts:
    12
    Additionally, what we are reported. All exceptions almost reduced to zero when we remove "Application.Quit()" usages

    Code (CSharp):
    1.  
    2. Caused by java.lang.UnsatisfiedLinkError: No implementation found for void com.unity3d.player.UnityPlayer.nativeFocusChanged(boolean) (tried Java_com_unity3d_player_UnityPlayer_nativeFocusChanged and Java_com_unity3d_player_UnityPlayer_nativeFocusChanged__Z)
    3.        at com.unity3d.player.UnityPlayer.nativeFocusChanged()
    4.        at com.unity3d.player.UnityPlayer.a()
    5.        at com.unity3d.player.UnityPlayer$e$1.handleMessage(:85)
    6.        at android.os.Handler.dispatchMessage(Handler.java:102)
    7.        at android.os.Looper.loop(Looper.java:164)
    8.  
    Code (CSharp):
    1.  
    2. Caused by java.lang.UnsatisfiedLinkError: No implementation found for void com.unity3d.player.UnityPlayer.nativeRecreateGfxState(int, android.view.Surface) (tried Java_com_unity3d_player_UnityPlayer_nativeRecreateGfxState and Java_com_unity3d_player_UnityPlayer_nativeRecreateGfxState__ILandroid_view_Surface_2)
    3.        at com.unity3d.player.UnityPlayer.nativeRecreateGfxState()
    4.        at com.unity3d.player.UnityPlayer.a()
    5.        at com.unity3d.player.UnityPlayer$19.run()
    6.        at android.os.Handler.handleCallback(Handler.java:739)
    7.        at android.os.Handler.dispatchMessage(Handler.java:95)
    8.        at android.os.Looper.loop(Looper.java:145)
    9.        at com.unity3d.player.UnityPlayer$e.run()
    10.  
    Code (CSharp):
    1.  
    2. Caused by java.lang.UnsatisfiedLinkError: No implementation found for void com.unity3d.player.UnityPlayer.nativeDone() (tried Java_com_unity3d_player_UnityPlayer_nativeDone and Java_com_unity3d_player_UnityPlayer_nativeDone__)
    3.        at com.unity3d.player.UnityPlayer.nativeDone()
    4.        at com.unity3d.player.UnityPlayer.g()
    5.        at com.unity3d.player.UnityPlayer.k()
    6.        at com.unity3d.player.UnityPlayer$21.run()
    7.        at android.os.Handler.handleCallback(Handler.java:739)
    8.        at android.os.Handler.dispatchMessage(Handler.java:95)
    9.        at android.os.Looper.loop(Looper.java:148)
    10.        at com.unity3d.player.UnityPlayer$e.run()
    11.  
    Code (CSharp):
    1.  
    2. Caused by java.lang.UnsatisfiedLinkError: No implementation found for void com.unity3d.player.UnityPlayer.nativeRestartActivityIndicator() (tried Java_com_unity3d_player_UnityPlayer_nativeRestartActivityIndicator and Java_com_unity3d_player_UnityPlayer_nativeRestartActivityIndicator__)
    3.        at com.unity3d.player.UnityPlayer.nativeRestartActivityIndicator()
    4.        at com.unity3d.player.UnityPlayer.resume()
    5.        at com.unity3d.player.UnityPlayerActivity.onResume()
    6.        at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1269)
    7.        at android.app.Activity.performResume(Activity.java:6297)
    8.        at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3398)
    9.        at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3440)
    10.        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1474)
    11.        at android.os.Handler.dispatchMessage(Handler.java:102)
    12.        at android.os.Looper.loop(Looper.java:135)
    13.        at android.app.ActivityThread.main(ActivityThread.java:5910)
    14.        at java.lang.reflect.Method.invoke(Method.java)
    15.        at java.lang.reflect.Method.invoke(Method.java:372)
    16.        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405)
    17.        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
    18.  
    Code (CSharp):
    1.  
    2. Caused by java.lang.UnsatisfiedLinkError: No implementation found for boolean com.unity3d.player.UnityPlayer.nativeInjectEvent(android.view.InputEvent) (tried Java_com_unity3d_player_UnityPlayer_nativeInjectEvent and Java_com_unity3d_player_UnityPlayer_nativeInjectEvent__Landroid_view_InputEvent_2)
    3.        at com.unity3d.player.UnityPlayer.nativeInjectEvent()
    4.        at com.unity3d.player.UnityPlayer.injectEvent(:8)
    5.        at com.unity3d.player.UnityPlayerActivity.onKeyUp(:2)
    6.        at android.view.KeyEvent.dispatch(KeyEvent.java:2715)
    7.        at android.app.Activity.dispatchKeyEvent(Activity.java:3286)
    8.        at com.unity3d.player.UnityPlayerActivity.dispatchKeyEvent(:14)
    9.        at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:354)
    10.        at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4747)
    11.        at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4619)
    12.        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4161)
    13.        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4214)
    14.        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4180)
    15.        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4307)
    16.        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4188)
    17.        at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4364)
    18.        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4161)
    19.        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4214)
    20.        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4180)
    21.        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4188)
    22.        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4161)
    23.        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4214)
    24.        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4180)
    25.        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4340)
    26.        at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:4501)
    27.        at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:2435)
    28.        at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:1998)
    29.        at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:1989)
    30.        at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:2412)
    31.        at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:141)
    32.        at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
    33.        at android.os.MessageQueue.next(MessageQueue.java:325)
    34.        at android.os.Looper.loop(Looper.java:142)
    35.        at android.app.ActivityThread.main(ActivityThread.java:6518)
    36.        at java.lang.reflect.Method.invoke(Method.java)
    37.        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
    38.        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
    39.  
     
  6. Rutger

    Rutger

    Joined:
    Sep 17, 2013
    Posts:
    34
    Just wondering.
    Did you remove all options to quit from your app or used a different way to close it?

    Code (CSharp):
    1. System.Diagnostics.Process.GetCurrentProcess().Kill();
    or Backgrounding instead of quitting
    Code (CSharp):
    1.  
    2. AndroidJavaObject __activity = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic<AndroidJavaObject>("currentActivity");
    3.             __activity.Call<bool>("moveTaskToBack", true);
     
  7. onur-gg

    onur-gg

    Joined:
    Dec 14, 2015
    Posts:
    12
    We change with backgrounding on Android
     
  8. Rutger

    Rutger

    Joined:
    Sep 17, 2013
    Posts:
    34
    Cool. Thanks for sharing this information.
    It will save us some time.
     
  9. AKPublish

    AKPublish

    Joined:
    Dec 14, 2016
    Posts:
    9
    We experience the same issue.
     
  10. Rutger

    Rutger

    Joined:
    Sep 17, 2013
    Posts:
    34
    Just now did a test.
    Built with 2018.4.21f1, and after backgrounding, tried to do an Application.Unload() which resulted in another crash.

    Hopefully this will assist Unity in discovering the cause of the issue.
    Here's also hoping we may get an official response from someone soon.

    In the meantime, simply backgrounding solves our (immediate) issue.
     
  11. Rutger

    Rutger

    Joined:
    Sep 17, 2013
    Posts:
    34
    In a new production build. Built with 2018.4.21f1 at a point where we don't call Application.Quit (since we only do the backgrounding now; see above), but OnApplicationQuit() is being called anyway, we still receive the following crash.

    Code (js):
    1. Caused by java.lang.UnsatisfiedLinkError: No implementation found for void com.unity3d.player.UnityPlayer.nativeRecreateGfxState(int, android.view.Surface) (tried Java_com_unity3d_player_UnityPlayer_nativeRecreateGfxState and Java_com_unity3d_player_UnityPlayer_nativeRecreateGfxState__ILandroid_view_Surface_2)
    2.        at com.unity3d.player.UnityPlayer.nativeRecreateGfxState()
    3.        at com.unity3d.player.UnityPlayer.a()
    4.        at com.unity3d.player.UnityPlayer$19.run()
    5.        at android.os.Handler.handleCallback(Handler.java:739)
    6.        at android.os.Handler.dispatchMessage(Handler.java:95)
    7.        at android.os.Looper.loop(Looper.java:135)
    8.        at com.unity3d.player.UnityPlayer$e.run()

    Would be great to have someone from Unity chime in on this soon!
    Maybe @Tomas1856 could take a look?
    I mean it clearly started since 2018.4.20 and we can try to make workaround solutions, but it's an Unity issue.
    Would be good to know that Unity is at least aware of this problem (has seen this thread).
     
  12. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    We are aware of this issue, the fix for this regression is being tested by QA now.
     
    Rutger likes this.
  13. Rutger

    Rutger

    Joined:
    Sep 17, 2013
    Posts:
    34
    Great to hear!
    Thanks for letting us know.
     
  14. magicpinfinance

    magicpinfinance

    Joined:
    Dec 13, 2017
    Posts:
    2
    In which release will fix be out. We are also facing the same issue.
     
    Rutger likes this.
  15. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    The fix should be in 2018.4.23f1
     
  16. Kohlhaas1808

    Kohlhaas1808

    Joined:
    Apr 7, 2017
    Posts:
    3
    Hi, I have the same issue in production. I hope it will be fixed very soon!
    Is there an release date for 2018.4.23?
     
    Last edited: May 13, 2020
    MagicMiikka likes this.
  17. jwtan_unity

    jwtan_unity

    Unity Technologies

    Joined:
    Nov 28, 2018
    Posts:
    12
    This fix should have already landed in 2018.4.22f1. Unfortunately, the changelog seems to be missing from the release notes. We are currently working on getting it added.
     
  18. Kohlhaas1808

    Kohlhaas1808

    Joined:
    Apr 7, 2017
    Posts:
    3
    Hi, ok thanks for that info. I'm going to test 2018.4.22f1 and let you know if the fix is working.
     
    Rutger likes this.
  19. ShinSeok

    ShinSeok

    Joined:
    Jan 17, 2015
    Posts:
    5
    Is this really fixed in 2018.4.22f1? I was wondering if it was confirmed.
     
    Rutger likes this.
  20. silvio_HARDlight

    silvio_HARDlight

    Joined:
    Jun 11, 2018
    Posts:
    7
    Yeah I'd be interested as well in knowing if it was fixed.
     
    Rutger likes this.
  21. NiallSoe

    NiallSoe

    Joined:
    Jan 30, 2018
    Posts:
    17
    @jwtan_unity @JuliusM

    Has this definitely been fixed in 2018.4.22? We are experiencing a lot of quit crashes that are severely impacting our android app health and consequently our install numbers.
     
  22. Rutger

    Rutger

    Joined:
    Sep 17, 2013
    Posts:
    34
    It may be too soon to tell (still slowly rolling out our new release), but seems to no longer appear in our crash logs. Build using 2018.4.23f1
     
  23. NiallSoe

    NiallSoe

    Joined:
    Jan 30, 2018
    Posts:
    17
    We can confirm this has been fixed now in 2018.4.23. Thanks!
     
  24. Shefich

    Shefich

    Joined:
    May 23, 2013
    Posts:
    143
    I can see such errors after Application.Quit in unity 2020.3.34, 2020.3.35, 2020.3.36.
    libunity.so nativeDone(_JNIEnv*, _jobject*)
     
  25. Shefich

    Shefich

    Joined:
    May 23, 2013
    Posts:
    143
    Tested on 2020.3.37 and on 2020.3.38 and I can still see the issue.
     
    burak-cypher, czzou and Franciscotx56 like this.