我为 Android 开发 AdobeAIR 应用程序。因此,我尝试制作访问 GooglePlay GameServices 的 ANE(ActionScript Native Extensions)。但是,由于以下问题,它现在正在工作。
[错误]
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)
[原因]
- 此错误归因于将 appid-number 直接写入 AIR APP 的 Manifest-file(XXXX-app.xml)。→如果我开发 native-app(Java) ,我指的是「res」文件夹(res/values/string.xml)。但是,AIR App 无法显式读取「res」文件夹,所以我别无选择。(对吗?)</li>
前任。)
(XXXX-app.xml)
<manifestAdditions><![CDATA[<manifest>
<application>
<meta-data android:name="com.google.android.gms.games.APP_ID"
android:value="123456789012" />
</application>
</manifest>]]></manifestAdditions>
有什么好主意吗?