问题描述
我试图谷歌加支持添加到一个空手机应用程序创建一个原生扩展。在code工作在一个单独的项目却试图使用它作为一个原生扩展产生以下错误:
I am attempting to add Google Plus support to an Air mobile app by creating a native extension. The code works in a standalone project however attempting to use it as a native extension produces the following error:
Failed resolving Lcom/myname/ane/sharingextensions/googleplus/GooglePlusConnect; interface 479 'Lcom/google/android/gms/common/api/GoogleApiClient$ConnectionCallbacks;'
04-08 15:51:29.573: W/dalvikvm(19956): Link of class 'Lcom/myname/ane/sharingextensions/googleplus/GooglePlusConnect;' failed
在我看来,谷歌播放服务库实际上没有被包括在本机扩展。在谷歌播放-services_lib项目添加为库项目,以我的原生扩展项目。我试图从谷歌播放-services_lib项目提取的bin /谷歌播放-services_lib.jar文件和内容更新我的原生扩展jar
It seems to me that the Google Play Services library is not actually being included in the native extension.The google-play-services_lib project is added as a library project to my native extension project. I have tried extracting the bin/google-play-services_lib.jar file from the google-play-services_lib project and updating my native extension jar with the contents
jar xf /path-to-play-services-project/bin/google-play-services_lib.jar
jar uf ./my_gplus_extension.jar ./android
不过这似乎并没有解决这个问题(所有这似乎是在那里是一个UnusedStub.class文件)。我也更新了Android SDK的Adobe AIR目录到版本19(这里描述的的),但是这也没有效果。有问题的类是:
but this does not seem to fix the problem (all that seems to be in there is a single "UnusedStub.class" file). I have also updated the Android SDK in the Adobe Air directory to version 19 (as described here http://lancelotmobile.com/blog/air-compile-for-android-4/) but this also has had no effect.The offending class is:
public class GooglePlusConnect extends FragmentActivity implements
ConnectionCallbacks, OnConnectionFailedListener,
ResultCallback<People.LoadPeopleResult> {
//Pretty much a clone of the google plus sign-in sample project
}
这将是巨大的,如果任何人有任何深入了解这还是能发现我已经做任何愚蠢的错误。
It would be great if anyone had any insight into this or can spot any daft mistakes I have made.
推荐答案
我想我只是回答我自己的问题,好像我需要被提取/内容路径到播放服务项目/库/谷歌 - 播放 - services.jar实际上包含很多东西,并纠正该链接错误,当我与它的内容更新我的扩展jar文件。下面似乎排序:
I think I just answered my own question, seems like I need to be extracting the contents of /path-to-play-services-project/libs/google-play-services.jar which actually contains lots of stuff, and corrects that link error when I update my extension jar file with its contents. The following seems to sort it:
jar xf /path-to-play-services-project/libs/google-play-services.jar
jar uf ./my_gplus_extension.jar ./com
这篇关于谷歌,加上ANE AIR本机扩展未能解决接口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!