question

e.timofeev@flexilestudio.com avatar image
e.timofeev@flexilestudio.com asked

Android build crash during PF log in

Hi All.
Have a problem that arises in the Android build.
When I try to log in with existing account, app just crashed during login process.
Some problem arises also with another PlayFab activity: registration, etc
I think the app can't call PlayFabClientAPI.LoginWithPlayFab and other PlayFab methods, cause method's callback's are not obtained.

PlayFab version from 18.12.2017
Unity 2017.2.0f3

Some errors was received from Android Manager:
12-20 22:36:39.658: E/(22183): netstack: STAT_HUB - App su.flex.pigbangru isn't supported

12-20 22:36:39.798: E/Web Console(22183): Viewport argument key "viewport-fit" not recognized and ignored. at file:///data/data/su.flex.pigbangru/files/UnityAdsWebApp.html?platform=android&origin=https%3A%2F%2Fwebview.unityads.unity3d.com%2Fwebview%2F2.1.1%2Fd5d5b1f9a0e27ca4b7608d0618f540ad%2Frelease%2Findex.html&version=d5d5b1f9a0e27ca4b95058d760f540ad:7

12-20 22:37:19.701: E/CRASH(22183): pid: 22183, tid: 22207, name: UnityMain >>> su.flex.pigbangru <<<

12-20 22:37:19.711: E/CRASH(22183): 6232579c 610bcb18 /mnt/asec/su.flex.pigbangru-1/lib/libunity.so (Coroutine::CleanupCoroutine(void*))

Сan anyone help? This is PlayFab problem or not?

android
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1807605288 avatar image
1807605288 answered

We submitted a fix for this, but it never got published!

This is completely my fault, many apologies!

This Unity Package will fix your issue for today.

  1. Download the package
  2. Disable compression from the PlayFabSharedSettings scriptable object


10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

No, none of the errors listed are related to our SDK in any way. That looks like a problem with your manifest. What permissions have you set in it?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1807605288 avatar image
1807605288 answered

Nov-27 is the most recent PlayFab release version. You can verify your actual PlayFab version by printing: PlayFab.PlayFabSettings.SdkVersion, or by looking on the PlayFab EditorExtensions panel, if you've installed it: EdEx-Unity-Package.

Those logs don't really seem to indicate a problem within PlayFab. We use a coroutine within the SDK, but that's been thoroughly tested on all platforms (including Android), and has never been a problem before.

This line:
Viewport argument key "viewport-fit" not recognized and ignored.
Makes me believe that you have some kind of UI bug.

Given the information in this post, I can't see any evidence that it's an issue with the PlayFab SDK, nor can I see the real problem you're stuck on, sorry.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

e.timofeev@flexilestudio.com avatar image
e.timofeev@flexilestudio.com answered

@Brendan, permissions in Manifest looks like:
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android.permission.USE_CREDENTIALS" /> <uses-permission android:name="android.permission.GET_ACCOUNTS" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="com.android.vending.BILLING" />

Now application does't crash. I set permissions in manifest, set right keystore, keys and package name in PlayerSettings, maybe that was a crash reason. But now upon attempt log in into PF account or email recovery, receive exceptions:

playfaberror(service unavailable, unhandled error in playfabwww: system.nullreferenceexception: object reference not set to an instance of an object at unityengine.www.get_responseheaders() [0x0076] in users/builduser/buildslave/unity/build/runtime/webrequestwww/uwrwww.cs:158

at playfab.internal.playfabwww+<post>c__iterator0.movenext () [0x0007c] in C:\...\Assets\playfabsdk\shared\internal\playfabhttp\playfab222.cs:176, 400 badrequest)

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image brendan commented ·

Let's do two things:

First, try making the call through Postman, so that you can verify your inputs and the result.

Once that's done, try logging all the details of the inputs you're passing into the Login call in your project, and the complete response from the service.

0 Likes 0 ·
revanflash avatar image
revanflash answered

So I've been dealing with a similar issue. The weird thing's that it was happening only in release build, so it was quite difficult to get a proper error message. Some -logcat + Debug.Log revealed that the crash took place at PlayFabWww.Post somewhere around the line "responseHeaders = www.responseHeaders;".

The provided update in this thread did not help unfortunately. However changing "request type" from "www" to "http web request" fixed it for me.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image brendan commented ·

Yes, you're not the first to see Unity WWW as having issues. Switching to HTTP Web Request usually works, when you run into this.

0 Likes 0 ·
1807605288 avatar image 1807605288 ♦ commented ·

You must use the given update, AND disable compression.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.