facebook sdk for unity 6.0 got very minor bug
They detect if u have keytool using following function in FacebookAndroidUtil.cs
private static bool DoesCommandExist(string command)
{
var proc = new Process();
if (Application.platform == RuntimePlatform.WindowsEditor)
{
proc.StartInfo.FileName = "cmd";
proc.StartInfo.Arguments = @"/C" + command;
}
else
{
proc.StartInfo.FileName = "bash";
proc.StartInfo.Arguments = @"-c " + command;
}
proc.StartInfo.UseShellExecute = true;
proc.StartInfo.CreateNoWindow = false;
proc.Start();
proc.WaitForExit();
if (Application.platform == RuntimePlatform.WindowsEditor)
{
return (proc.ExitCode == 0);
}
else
{
return proc.ExitCode != 127;
}
}
If you open a command prompt and type keytool, it show up all the parameter that you can use for the command keytool.
It will not exit with exitCode 0 but 1 which means partially success as no parameter is provided for keytool. so the check for if you have keytool always failed.
Actually you can turn on shell by change proc.StartInfo.UseShellExecute = false; to true and you can see the parameter hint come out for the command keytool , which means keytool is there. it just the DoesCommanExist have a bug.
The fix is change
return (proc.ExitCode == 0);
to
return (proc.ExitCode == 0||proc.ExitCode == 1);
I know nothing about cmd but this page tell me, exitcode 1 mean partially succeed.
http://msdn.microsoft.com/en-us/library/ms194959(v=vs.100).aspx
출처 - http://forum.unity3d.com/threads/keytool-not-found-facebook-sdk-on-android-native-plugin.239696/
'Unity' 카테고리의 다른 글
Android 다국어 셋팅시 (0) | 2015.03.04 |
---|---|
major version 51 is newer than 50 the highest major version supported by this compiler (0) | 2015.02.15 |
유니티 <-> MS-SQL 연동. (0) | 2014.02.12 |
NGUI 기기별 해상도 셋팅시 코드 (0) | 2013.11.21 |
유니티와 안드로이드 설정 및 핸드폰 번호 가져오기 (1) | 2013.11.04 |
WRITTEN BY