Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed a NullPointerException in com.facebook.unity.FB.getKeyHash #372

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

kabamwchang
Copy link

@kabamwchang kabamwchang commented Jan 14, 2020

Thanks for proposing a pull request!

To help us review the request, please complete the following:

  • sign contributor license agreement
  • I've ensured that all existing tests pass and added tests (when/where necessary)
  • I've updated the documentation (when/where necessary) and Changelog (when/where necessary)
  • I've added the proper label to this pull request (e.g. bug for bug fixes)

Pull Request Details

This change fixes a rare NullPointerException crash on SM-T113 devices running Android OS 4.4.4 / API-19

Test Plan

This change has been pushed into production and verified through crash telemetry.

Fix a rare NullPointerException on SM-T113 devices running Android OS 4.4.4 / API-19
Fix a rare NullPointerException on SM-T113 devices running Android OS 4.4.4 / API-19
@kabamwchang
Copy link
Author

I do not appear to have permissions to add labels, so I am unable to add the "bug" label.

@kabamwchang kabamwchang marked this pull request as ready for review January 14, 2020 19:51
@troy-lamerton
Copy link

This is still an issue with SDK v11.0.0 - 2021-06-05

Here is the stacktrace we're seeing:

java.lang.NullPointerException Attempt to get length of null array 
    SourceFile:5 com.facebook.unity.FB.getKeyHash()
    SourceFile:4 com.facebook.unity.FB$1.onInitialized()
    SourceFile:2 c.a.o.k()
    SourceFile:7 com.facebook.unity.FB.Init()
    Native Method com.unity3d.player.UnityPlayer.nativeRender()
    Unknown Source com.unity3d.player.UnityPlayer.access$300()
    Unknown Source:83 com.unity3d.player.UnityPlayer$e$1.handleMessage()
    Handler.java:102 android.os.Handler.dispatchMessage()
    Looper.java:201 android.os.Looper.loop()
    Unknown Source:20 com.unity3d.player.UnityPlayer$e.run()
    <00000000000000000000000000000000> UnityEngine.AndroidJNISafe.CheckException()
    <00000000000000000000000000000000> UnityEngine.AndroidJavaObject._CallStatic(System.String methodName, System.Object[] args)
    <00000000000000000000000000000000> Facebook.Unity.Mobile.Android.AndroidFacebook.Init(System.String appId, Facebook.Unity.HideUnityDelegate hideUnityDelegate, Facebook.Unity.InitDelegate onInitComplete)
    <00000000000000000000000000000000> Facebook.Unity.FB+OnDLLLoaded.Invoke()
    <00000000000000000000000000000000> Facebook.Unity.FB+CompiledFacebookLoader.Start()

For our app, this has happened on Android versions 10/9/8.1. Mostly HUAWEI and Vivo devices, but also some from Xiaomi and OnePlus devices.

I believe this pull request will fix the above crash so please consider merging this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants