[FIXED] UCB Team - Android Builds with the Facebook SDK are failing 17th March

Hello everyone,

We’re aware of an issue causing Android builds to fail if they contain the Facebook SDK. You may see an error message like

The team is working on a fix. I’ll update this thread when we have more information.

Thanks,

  • Sophia

This issue has been fixed! Thanks for your patience everyone!

  • Sophia

When and where was this fixed? We’re having this problem in 5.5.2p2 as of today.

I believe you have submitted a ticket so we will be handling your issue through that :slight_smile:

  • Sophia

Hi, @SophiaC .

We use Jenkins to build our game, and are running into the same issue. Can you elaborate on how you solved the problem for Unity Cloud Build?

The issue was to do with Gradle and the Android Keystore. Others have been seeing a similar issue appear recently, but it is being caused by different issues: https://forum.unity3d.com/threads/cloud-build-still-fails-build-with-facebook-sdk-when-build-on-5-6.467205/#post-3054786

Can you elaborate further than just Gradle and the Android Keystore? I’m happy to muck around in shell scripts and Unity Editor code to fix the problem, but it’s very opaque and since it doesn’t happen when building through the editor itself (only via the command line), it’s very tough for me to fix it without more information.

The Facebook SDK looks for the debug android keystore on your machine - we made changes with Gradle that caused that keystore to not automatically be generated. This was resolved on the Cloud Build side on March 17th.

Hope this helps you figure out what’s happening to your project.

  • Sophia

The weird part (to me, at least) is that I have a debug.keystore file on my build machine under %HOMEPATH%.android (Windows box).

Building inside the editor itself happens just fine using the exact same method call I use when building via batch mode, but building on the command line using batch mode fails.

Update: Looks like I fixed it. This obviously isn’t really a problem for Cloud Build, but if anyone is having this issue with Jenkins, it might be because Jenkins strips your environment before builds. The Facebook Unity plugin explicitly checks for the HOMEPATH and HOMEDRIVE environment variables when trying to find the debug keystore. However, since Jenkins has stripped those variables before its run, the plugin fails to find the file and aborts the build.

The solution, in this case, was to use the EnvInject Jenkins plugin to re-inject the variables before the build. Just make sure that when you do, you escape the backslash (if you’re using Windows as your Jenkins slave) for the path. For example, your EnvInject configuration might look like this:

HOMEDRIVE=C:
HOMEPATH=\Users\YourUsername

I am having this in 2017.3

Having that as well now after switching to 2017.3 :frowning:

Still having it. Did someone find the solution?

I just added the debug.keystore file to this path: “C:\Users<user>.android” and the error went away.

Attached the file inside a zip file in case someone needs it.

3389144–266426–debug.zip (2.21 KB)

I am having this same error Unity 2017.3 Where is the debug.keystore file kept? I can’t find it. Any help is appreciated.

drag the above file provided into the .android folder. this solved the issue for me.
i am not sure how you access the android folder on windows but on mac just type

open ~/.android/ into the terminal and it should take you to the folder.

Dude you are AWESOME!!!

I have same error. But build grandle not fix. I use unity 2017.3 , FB SDK 7.13.0 , Admob v3.13.1.
Output log:

Your Android setup is not correct. See Settings in Facebook menu.
UnityEngine.Debug:LogError(Object)
Facebook.Unity.Editor.XCodePostProcess:OnPostProcessBuild(BuildTarget, String)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Error building Player: Your Android setup is not correct. See Settings in Facebook menu.

Build completed with a result of ‘Failed’

UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0020e] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:181
at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00065] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:88
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

@SophiaC I am having this issue in Unity 2018.2.0f2. What should I do now?

@Mewada-Neil
me too

i have this follow error please anybody have a solution . i use unity 2018.1 and facebook sdk 7.13.0

Your Android setup is not correct. See Settings in the Facebook menu.
UnityEngine.Debug:LogError(Object)
Facebook.Unity.Editor.XCodePostProcess:OnPostProcessBuild(BuildTarget, String)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)