Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 将Google Play服务包括在钛模块中_Android_Ant_Titanium_Google Play Services_Titanium Modules - Fatal编程技术网

Android 将Google Play服务包括在钛模块中

Android 将Google Play服务包括在钛模块中,android,ant,titanium,google-play-services,titanium-modules,Android,Ant,Titanium,Google Play Services,Titanium Modules,我正在尝试构建一个钛安卓模块,它使用谷歌Play服务作为库。包括图书馆在内我遇到了麻烦。以下是我迄今为止所尝试的: 我试着加上 android.library.reference.1=path/to/google/play/services/lib 到我的android文件夹中的build.properties,但无效。蚂蚁没有认出它 之后,我尝试将.jar文件复制到android/lib文件夹中,将res文件夹复制到platform/android/res中。这导致模块编译,但在尝试使用它

我正在尝试构建一个钛安卓模块,它使用谷歌Play服务作为库。包括图书馆在内我遇到了麻烦。以下是我迄今为止所尝试的:

我试着加上

android.library.reference.1=path/to/google/play/services/lib
到我的android文件夹中的build.properties,但无效。蚂蚁没有认出它

之后,我尝试将.jar文件复制到android/lib文件夹中,将res文件夹复制到platform/android/res中。这导致模块编译,但在尝试使用它时,出现以下错误:

[ERROR] GooglePlayServicesUtil: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
[DEBUG] AndroidRuntime: Shutting down VM
[ERROR] TiApplication: (main) [88,5294] Sending event: exception on thread: main msg:java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/R$style;; Titanium 3.4.0,2014/09/25 16:42,b54c467
[ERROR] TiApplication: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/R$style;
[ERROR] TiApplication:  at com.google.android.gms.wallet.fragment.WalletFragmentStyle.Z(Unknown Source)
[ERROR] TiApplication:  at com.google.android.gms.wallet.fragment.WalletFragmentOptions.Z(Unknown Source)
[ERROR] TiApplication:  at com.google.android.gms.wallet.fragment.SupportWalletFragment.onCreate(Unknown Source)
[ERROR] TiApplication:  at android.support.v4.app.Fragment.performCreate(Fragment.java:1477)
[ERROR] TiApplication:  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:904)
[ERROR] TiApplication:  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1115)
[ERROR] TiApplication:  at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
[ERROR] TiApplication:  at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1478)
[ERROR] TiApplication:  at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:570)
[ERROR] TiApplication:  at com.*snip*.onStart(InstantBuyActivity.java:104)
[ERROR] TiApplication:  at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1220)
[ERROR] TiApplication:  at android.app.Activity.performStart(Activity.java:5949)
[ERROR] TiApplication:  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2261)
[ERROR] TiApplication:  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
[ERROR] TiApplication:  at android.app.ActivityThread.access$800(ActivityThread.java:144)
[ERROR] TiApplication:  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
[ERROR] TiApplication:  at android.os.Handler.dispatchMessage(Handler.java:102)
[ERROR] TiApplication:  at android.os.Looper.loop(Looper.java:135)
[ERROR] TiApplication:  at android.app.ActivityThread.main(ActivityThread.java:5221)
[ERROR] TiApplication:  at java.lang.reflect.Method.invoke(Native Method)
[ERROR] TiApplication:  at java.lang.reflect.Method.invoke(Method.java:372)
[ERROR] TiApplication:  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
[ERROR] TiApplication:  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
[ERROR] TiApplication: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.R$style" on path: DexPathList[[zip file "/data/app/*snip*"],nativeLibraryDirectories=[/data/app/*snip*/lib/arm, /vendor/lib, /system/lib]]
[ERROR] TiApplication:  at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
[ERROR] TiApplication:  at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
[ERROR] TiApplication:  at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
[ERROR] TiApplication:  ... 23 more
[ERROR] TiApplication:  Suppressed: java.lang.ClassNotFoundException: com.google.android.gms.R$style
[ERROR] TiApplication:      at java.lang.Class.classForName(Native Method)
[ERROR] TiApplication:      at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
[ERROR] TiApplication:      at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
[ERROR] TiApplication:      at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
[ERROR] TiApplication:      ... 24 more
[ERROR] TiApplication:  Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

我在Google上找到的所有结果都表明我没有正确引用该项目,但我似乎找不到一种方法将其包含到项目中,让ant识别它并且不给我一大堆错误。有人成功过吗?

我使用Tianium Studio将google-play-services.jar添加到项目的构建路径中,并确保我将实际文件复制到projector/android/lib,否则它会抱怨找不到它。

您使用play services的目的是什么?您可以运行其中的一些方法,而不必使用R样式。