如何使ANE访问GooglePlay GameServices [英] How to make ANE that accesses GooglePlay GameServices

查看:155
本文介绍了如何使ANE访问GooglePlay GameServices的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发AdobeAIR应用程序为Android。 所以,我尽量让ANE(动作脚本本机扩展)访问GooglePlay GameServices。 但是,现在的工作,因为存在以下问题。

I develop AdobeAIR App for Android. So, I try to make ANE(ActionScript Native Extensions)that accesses GooglePlay GameServices. But, it is now working because of the following problem.

[错误]

07-22 11:22:44.976: W/Bundle(24987): Key com.google.android.gms.games.APP_ID expected String but value was a java.lang.Integer.  The default value <null> was returned.
07-22 11:22:44.991: W/Bundle(24987): Attempt to cast generated internal exception:
07-22 11:22:44.991: W/Bundle(24987): java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
07-22 11:22:44.991: W/Bundle(24987):    at android.os.Bundle.getString(Bundle.java:1069)
07-22 11:22:44.991: W/Bundle(24987):    at abh.a(SourceFile:137)
07-22 11:22:44.991: W/Bundle(24987):    at ato.a(SourceFile:450)
07-22 11:22:44.991: W/Bundle(24987):    at com.google.android.gms.games.service.GamesIntentService.onHandleIntent(SourceFile:2257)
07-22 11:22:44.991: W/Bundle(24987):    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
07-22 11:22:44.991: W/Bundle(24987):    at android.os.Handler.dispatchMessage(Handler.java:99)
07-22 11:22:44.991: W/Bundle(24987):    at android.os.Looper.loop(Looper.java:137)
07-22 11:22:44.991: W/Bundle(24987):    at android.os.HandlerThread.run(HandlerThread.java:60)

[原因]

[Cause]

  • 在这个错误的属性直接写的appid,数 清单文件AIR应用程序中(XXXX-app.xml中)。 →如果我开发 本机应用程序(Java)的,我指的是「资源」文件夹(RES /价值/ string.xml)。 但是,AIR应用程序无法读取「资源」文件夹明确,所以我没有 其他的选择。(正确吗?)
  • This error attributes to write appid-number directly to Manifest-file(XXXX-app.xml) of AIR APP. →If I develop native-app(Java) , I refer to「res」folder(res/values/string.xml). But, AIR App can't read the 「res」folder explicitly, so I have no other choice.(correct?)

例)

(XXXX-app.xml)
<manifestAdditions><![CDATA[<manifest>
    <application>
        <meta-data android:name="com.google.android.gms.games.APP_ID"
                android:value="123456789012" />     
    </application>
</manifest>]]></manifestAdditions>

有什么好的想法?

Any good ideas?

推荐答案

您可能需要在你的Andr​​oid开始添加一个反斜杠空间:值,像这样:

You may need to add a backslash-space at the start of your android:value like so:

<meta-data android:name="com.google.android.gms.games.APP_ID"
            android:value="\ 123456789012" /> 

这是因为,ID也作为一个字符串,但只输入123456789012将PTED从XML整数除$ P $。

This is because the id is expected as a string, but entering just "123456789012" will be interpreted as an integer from XML.

这篇关于如何使ANE访问GooglePlay GameServices的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆