- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
Google Play 服务的 Unity3d 代码。我正在使用 GooglePlayGamesPlugin-0.9.36 和 Unity 5.4
using UnityEngine;
using System.Collections;
using UnityEngine.SocialPlatforms;
using GooglePlayGames;
public class MainGui : MonoBehaviour
{
private const float FontSizeMult = 0.05f;
private bool mWaitingForAuth = false;
private string mStatusText = "Ready.";
private bool dumpedToken = false;
void Start()
{
// Select the Google Play Games platform as our social platform implementation
PlayGamesPlatform.Activate();
}
void OnGUI()
{
GUI.skin.button.fontSize = (int)(FontSizeMult * Screen.height);
GUI.skin.label.fontSize = (int)(FontSizeMult * Screen.height);
GUI.Label(new Rect(20, 20, Screen.width, Screen.height * 0.25f),
mStatusText);
Rect buttonRect = new Rect(0.25f * Screen.width, 0.10f * Screen.height,
0.5f * Screen.width, 0.25f * Screen.height);
Rect imageRect = new Rect(buttonRect.x + buttonRect.width / 4f,
buttonRect.y + buttonRect.height * 1.1f,
buttonRect.width / 2f, buttonRect.width / 2f);
if (mWaitingForAuth)
{
return;
}
string buttonLabel;
if (Social.localUser.authenticated)
{
buttonLabel = "Sign Out";
if (Social.localUser.image != null)
{
GUI.DrawTexture(imageRect, Social.localUser.image,
ScaleMode.ScaleToFit);
}
else {
GUI.Label(imageRect, "No image available");
}
mStatusText = "Ready";
if (!dumpedToken)
{
string token = GooglePlayGames.PlayGamesPlatform.Instance.GetToken();
Debug.Log("AccessToken = " + token);
dumpedToken = token != null && token.Length > 0;
}
}
else {
buttonLabel = "Authenticate";
}
if (GUI.Button(buttonRect, buttonLabel))
{
if (!Social.localUser.authenticated)
{
// Authenticate
mWaitingForAuth = true;
mStatusText = "Authenticating...";
Social.localUser.Authenticate((bool success) =>
{
mWaitingForAuth = false;
if (success)
{
mStatusText = "Welcome " + Social.localUser.userName;
}
else {
mStatusText = "Authentication failed.";
}
});
}
else {
// Sign out!
mStatusText = "Signing out.";
((GooglePlayGames.PlayGamesPlatform)Social.Active).SignOut();
}
}
}
}
当我按下验证按钮时,应用程序崩溃。并且没有出现 Google Play 服务对话框。我已经构建了该应用程序并在 Android Mobile 中运行它。
02-25 20:18:42.181: A/DEBUG(583): pid: 23421, tid: 23439, name: main >>> devnp.testing <<<
02-25 20:18:42.197: W/debuggerd(583): type=1400 audit(0.0:35378): avc: denied { search } for name="devnp.testing" dev="dm-1" ino=141182 scontext=u:r:debuggerd:s0 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir permissive=0
02-25 20:18:42.260: A/DEBUG(583): #11 pc 0009221b /data/app/devnp.testing-1/lib/arm/libgpg.so
02-25 20:18:42.260: A/DEBUG(583): #12 pc 00092e37 /data/app/devnp.testing-1/lib/arm/libgpg.so
02-25 20:18:42.261: A/DEBUG(583): #13 pc 000933dd /data/app/devnp.testing-1/lib/arm/libgpg.so
02-25 20:18:42.261: A/DEBUG(583): #14 pc 0008dc69 /data/app/devnp.testing-1/lib/arm/libgpg.so (_ZNK3gpg28AndroidPlatformConfiguration5ValidEv+76)
02-25 20:18:42.261: A/DEBUG(583): #15 pc 00053441 /data/app/devnp.testing-1/lib/arm/libgpg.so (_ZN3gpg12GameServices7Builder6CreateERKNS_28AndroidPlatformConfigurationE+40)
02-25 20:18:42.261: A/DEBUG(583): #16 pc 000c73dd /data/app/devnp.testing-1/lib/arm/libgpg.so (GameServices_Builder_Create+16)
02-25 20:18:43.054: W/ActivityManager(1439): Force finishing activity devnp.testing/com.unity3d.player.UnityPlayerActivity
02-25 20:18:43.233: I/ActivityManager(1439): Process devnp.testing (pid 23421) has died
02-25 20:18:43.234: W/InputDispatcher(1439): channel 'd1b52d4 devnp.testing/com.unity3d.player.UnityPlayerActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9
02-25 20:18:43.234: E/InputDispatcher(1439): channel 'd1b52d4 devnp.testing/com.unity3d.player.UnityPlayerActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
02-25 20:18:43.237: I/WindowState(1439): WIN DEATH: Window{d1b52d4 u0 devnp.testing/com.unity3d.player.UnityPlayerActivity}
02-25 20:18:43.237: W/InputDispatcher(1439): Attempted to unregister already unregistered input channel 'd1b52d4 devnp.testing/com.unity3d.player.UnityPlayerActivity (server)'
最佳答案
降级 .aar 文件解决问题
参见:https://github.com/playgameservices/play-games-plugin-for-unity/issues/1604
旧文件:https://drive.google.com/drive/u/0/folders/0B-w9u2zDKrHGUmtjMmk2VDhhSjA
以下是我解决这个问题的方法:
转到“ Assets ”>“Play 服务解析器”>“Android 解析器”>“设置”取消勾选启用后台分辨率(一旦我们降级 .aar 文件,这将抑制更新通知)
转到 <android_sdk_path>\extras\google\m2repository\com\google\android\gms
.每个文件夹内都有版本文件夹(例如 10.0.1、10.2.0)。在这些里面是我们需要的 .aar 文件或从上面的谷歌驱动器链接下载我们需要以下文件:
下<unity_project_path>\Assets\Plugins\Android
删除上面 .aar 文件的 10.2.0 版本及其 META 文件。
关于android - Unity Google Play 服务插件 Social.localUser.Authenticate(...) 应用程序崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42457572/
我们正在使用 spring-social 将我们的应用程序集成到 Facebook。 在 OAuth2AuthenticationService 中,范围为空。 我们将范围设置为表单上的输入。但它不起
Python(3.6.7) 和 Django(2.1),尝试集成social-auth-app-django。 与this post不同,我已声明SOCIAL_AUTH_URL_NAMESPACE,但
ConnectController 和 ProviderSignInController 都可以创建与 Service Provider 的连接,所以我想知道 ConnectController 和
当应用程序在模拟器上运行时,我有以下执行问题: dyld: Library not loaded: /System/Library/Frameworks/Social.framework/Social
我正在尝试使用 python-social-auth 添加电子邮件身份验证。 Documentation说: 表单提交应该转到/complete/email,或者如果它转到您的 View ,那么您的
我已经阅读了很多关于 SO 的问题,但没有找到答案,所以决定发布此内容。我删除了 Twitter.framework,因为它是红色的,而且我已经有了 Social.framwork,所以我收到了错误
我正在将一个项目从使用 django-social-auth 移植到 python-social-auth。我关注了instructions在文档中,但是当我尝试运行项目的测试 (./manage.p
我想创建一个使用 django admin 的应用程序,但允许通过 google(我公司的 google 帐户)代替 django 默认 ModelAdmin 登录。 目前,它看起来像social-a
在django社交注册中,通常会重定向到 /social/setup . 所以我写了一个指向那个 url 的 View 。但是,为什么有时它会重定向到 /accounts/profi
我是 Spring 框架的初学者,想尝试使用 Spring Social 来制作一个从 Facebook 检索数据的简单 Web 应用程序。为此,我遵循了 Spring Socials 官方“入门指南
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎与 help center 中定义的范围内的编程无关。 . 关闭 7 年前。 Improve
这个问题已经有答案了: java.net.MalformedURLException: unknown protocol: classpath (2 个回答) 已关闭 7 年前。 我是 Spring
我的网站需要 spring social,但我的专家在查找它时遇到问题。我添加了 spring social core 和 spring social Facebook 依赖项,但我在 eclipse
关闭。这个问题需要更多 focused .它目前不接受答案。 想改进这个问题?更新问题,使其仅关注一个问题 editing this post . 6年前关闭。 Improve this questi
我计划实现一个基本的推荐系统,该系统使用 Facebook Connect 或类似的社交网站 API 来连接用户的个人资料,根据标签进行分析并使用结果在我的电子商务网站上生成项目推荐(工作方式类似于亚
乔尔·斯波尔斯基今天一遍又一遍地重复说,了解一点人类学对程序员来说非常有用,因为正在创建的大部分内容都是社交软件。 已经了解计算机科学的人如何学习了解人类如何运作所需的人类学?有什么书吗?有录课吗?
我怎样才能让 Spring Social 使用 facebook 和 twitter 登录有一个记住我的功能,这类似于在 Spring Security 中使用基于表单的登录的记住我登录? 我正在使用
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 7年前关闭。 Improve thi
我经营一个社交网络/博客网站 ( http://www.obsidianportal.com ),目前,用户在任何地方都通过其唯一(且不可更改)的用户名来识别。许多人都要求能够拥有一个他们可以选择的显
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
我是一名优秀的程序员,十分优秀!