question

jaime.matosic@enova.mx avatar image
jaime.matosic@enova.mx asked

Problem login in and creating the apk

Hi there!

I'm following the next tutorial: https://playfab.com/docs/
Set everything and when I run the script it tells me:
"Error logging in player with custom ID:
UnityEngine.Debug:Log(Object)
PlayFabManagers:<Login>m_AD(PlayFabError) (at Assets/Scripts/PlayFabManagers.cs:41)
PlayFab.<LoginWithCustomID>c
AnonStorey29:<>m4A(String, PlayFabError) (at Assets/PlayFabSDK/Public/PlayFabClientAPI.cs:195)
PlayFab.Internal.<MakeRequestViaUnity>c
Iterator0:MoveNext() (at Assets/PlayFabSDK/Internal/PlayFabHTTP.cs:249)"
-And-
"Could not resolve host: .playfabapi.com; Host not found
UnityEngine.Debug:Log(Object)
PlayFabManagers:<Login>m
AD(PlayFabError) (at Assets/Scripts/PlayFabManagers.cs:42)
PlayFab.<LoginWithCustomID>c
AnonStorey29:<>m4A(String, PlayFabError) (at Assets/PlayFabSDK/Public/PlayFabClientAPI.cs:195)
PlayFab.Internal.<MakeRequestViaUnity>c
_Iterator0:MoveNext() (at Assets/PlayFabSDK/Internal/PlayFabHTTP.cs:249)"

Then, I try to build the apk (I can build others apks but not this one) and it tells me:
"CommandInvokationFailure: Failed to re-package resources. See the Console for details."

Can anyone please, point me in the right direction?

Thank you

10 |1200

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

1 Answer

·
brendan avatar image
brendan answered

The error "Could not resolve host: .playfabapi.com" indicates that the Title ID for your game hasn't been added to the project (there should be a PlayFabSettings, if you're using one of our SDKs). The URL for all API calls for your title will be { {TitleID}}.playfabapi.com, where { {TitleID}} should be the actual Title ID for your game.

9 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.

jaime.matosic@enova.mx avatar image jaime.matosic@enova.mx commented ·

Thank you! That solved it :)

0 Likes 0 ·
Dustin Adair avatar image Dustin Adair commented ·

I'm getting this same error (using the Unity SDK): "Error logging in player with custom ID:"  "Could not resolve host: .playfabapi.com; Host not found"

I set up my gameID with: public string gameId; (and entered the game ID in the inspector)

And I called it with: Login (gameId); (I also tried it with Login ("xxxx") with xxxx set to my gameId)

I've tried it in Unity 5.2.1 & 5.3 with the editor in both Android and standalone modes as well as a build running on an Android. All of them produced the same result.

 

0 Likes 0 ·
brendan avatar image brendan Dustin Adair commented ·

The setting for Title ID in your project is in PlayFabSettings. Instructions on setting this are in the "Installing and Configuring the PlayFab Unity SDK" section of the readme for the SDK, here: https://github.com/PlayFab/UnitySDK.

0 Likes 0 ·
Dustin Adair avatar image Dustin Adair brendan commented ·

"The setting for Title ID in your project is in PlayFabSettings. Instructions on setting this are in the "Installing and Configuring the PlayFab Unity SDK" section of the readme for the SDK, here: https://github.com/PlayFab/UnitySDK."

Thanks for that link! I was following the intro info on this page: https://api.playfab.com/docs/getting-started-with-playfab Which unfortunately excludes the requirement to set the Title ID. You guys might want to add that bit to that example page as well.

Anyway, that addressed the issue for me. Thanks!

 

 

0 Likes 0 ·
Show more comments
whatupgames avatar image whatupgames commented ·

@Brendan - Just wanted to let you know that this is still happening. The flow that I am seeing is:

  1. Load Unity and run in the editor. You'll get the error.
  2. Open the PlayFab EdEx editor extension. Do not change any settings - just hit save again.
  3. Run the game in the editor and it is fixed.
0 Likes 0 ·
brendan avatar image brendan whatupgames commented ·
@WhatUpGames

- The issue is that you have to set your Title ID in the project before you can make API calls to the service. It can't be set in the SDK you download, so you have to either 1) Set it yourself in PlayFabSettings or 2) Use the Editor Extensions which use your login to grab data on the first title it sees in your Studio in the service (since you're signed into the Game Manager via EdEx).

0 Likes 0 ·
whatupgames avatar image whatupgames brendan commented ·

I don't think this is the issue that I was running into - as I do also have the Title ID set in my script (before and after the flow that I described previously). It's basically set in both spots.

0 Likes 0 ·
Show more comments

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.