如何在没有拖放支持的Genymotion模拟器中安装Google Play服务?
我不能像Stack Overflow post中提到的那样安装它如何在Genymotion虚拟设备上安装Google框架(Play,Accounts等)?由于缺乏对拖放安装的支持.
Genymotion支持几个模拟器的Google Apps,但它不支持平板电脑模拟器.
我实施新的谷歌云消息之后从谷歌开发者页面的导游在这里
我已成功运行并测试它.但我现在的问题是我有不同的productFlavors具有不同的applicationId/packageName和不同的GCM项目ID.在google-services.json具有在被投入/app/google-services.json不是味道文件夹.
有没有办法让google-services.json配置与许多口味不同?
我目前正在尝试Genymotion和男孩,它比ADT模拟器快得多.
但我需要安装Google Play才能将一些应用下载到其中.我该怎么做呢?
android android-virtual-device google-play-services genymotion
我有一个使用Google Maps Android v2 API的应用程序.我已将google-play-services_lib库项目添加到我的工作区,并根据这些页面上的说明从我的应用程序项目添加了对它的引用:
一切似乎都运行正常:应用程序使用默认标记显示地图和叠加层.所以我很确定我已经正确设置了Google Play服务和Google Maps API.
但是,每当初始化地图视图时(在第二代Nexus 7上),我都会在ADT LogCat窗口中看到此消息:
The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
Run Code Online (Sandbox Code Playgroud)
消息级别为Error,标记为GooglePlayServicesUtil.
这似乎是良性的,因为我的应用程序确实工作正常.但我该怎么做或检查以试图解决可能出现的问题?
更多信息:每次在LogCat中显示"未找到Google Play服务资源"消息时,都会显示以下消息,即警告并标记ResourceType:
getEntry failing because entryIndex 906 is beyond type entryCount 3
Failure getting entry for 0x7f0b038a (t=10 e=906) in package 0 (error -2147483647)
Run Code Online (Sandbox Code Playgroud)
FWIW,我在搜索项目时找不到常量0x7f0b038a,包括gen/R.java文件.
我检查了生成的.apk的内容,它包含了google-play-services_lib/res目录中的所有资源.
另一个更新:添加ActionBarSherlock并将清单中的targetSdkVersion从8更新为17后,我现在看到LogCat输出中的另一个错误:
Could not find class 'maps.af.k', referenced from method 'maps.ag.an.a' …Run Code Online (Sandbox Code Playgroud) 通过gradle引用播放服务停止为我工作 - 煮沸 - 甚至我作为参考的样本首先停止工作:https: //plus.google.com/+AndroidDevelopers/posts/4Yhpn6p9icf
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':auth'.
> Failed to notify project evaluation listener.
> Could not resolve all dependencies for configuration ':auth:compile'.
> Could not find com.google.android.gms:play-services:3.1.36.
Required by:
gpsdemos:auth:unspecified
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 3.577 secs
Run Code Online (Sandbox Code Playgroud)
我担心只是版本增加了但提出了两个问题:#1)新版本是什么?#2)为什么旧版本消失了?
错误:
任务':app:processDebugGoogleServices'的执行失败.请通过更新google-services插件的版本(此处提供有关最新版本的信息)或将com.google.android.gms的版本更新为8.3.0来修复版本冲突 .
我已经完成了我发现的所有事情.
dependencies {
// This does not break the build when Android Studio is missing the JRebel for Android plugin.
classpath 'com.zeroturnaround.jrebel.android:jr-android-gradle:1.0.+'
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
classpath 'com.google.gms:google-services:2.0.0-alpha3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Run Code Online (Sandbox Code Playgroud)
并在应用程序gradle中
compile 'com.google.android.gms:play-services:8.4.0'
Run Code Online (Sandbox Code Playgroud) 我正在使用谷歌地图Android SDK 11.6.2(也试过15.0.1),但我在地图显示之前遇到了崩溃.已经检查过清单中的API密钥,它可用,但仍会出现此问题.我有targetSDk版本为28.这是导致此问题.
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/ProtocolVersion;
at el.b(:com.google.android.gms.dynamite_mapsdynamite@12848063@12.8.48 (100408-196123505):3)
at ek.a(:com.google.android.gms.dynamite_mapsdynamite@12848063@12.8.48 (100408-196123505):4)
at em.a(:com.google.android.gms.dynamite_mapsdynamite@12848063@12.8.48 (100408-196123505):51)
at com.google.maps.api.android.lib6.drd.ap.a(:com.google.android.gms.dynamite_mapsdynamite@12848063@12.8.48 (100408-196123505):11)
at dw.a(:com.google.android.gms.dynamite_mapsdynamite@12848063@12.8.48 (100408-196123505):16)
at dw.run(:com.google.android.gms.dynamite_mapsdynamite@12848063@12.8.48 (100408-196123505):61)
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.ProtocolVersion" on path: DexPathList[[zip file "/system/priv-app/PrebuiltGmsCorePi/app_chimera/m/MapsDynamite.apk"],nativeLibraryDirectories=[/data/user_de/0/com.google.android.gms/app_chimera/m/00000036/MapsDynamite.apk!/lib/armeabi-v7a, /data/user_de/0/com.google.android.gms/app_chimera/m/00000036/MapsDynamite.apk!/lib/armeabi, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:126)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at ad.loadClass(:com.google.android.gms.dynamite_dynamiteloader@12848063@12.8.48 (100408-196123505):25)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at el.b(:com.google.android.gms.dynamite_mapsdynamite@12848063@12.8.48 (100408-196123505):3)
at ek.a(:com.google.android.gms.dynamite_mapsdynamite@12848063@12.8.48 (100408-196123505):4)
at em.a(:com.google.android.gms.dynamite_mapsdynamite@12848063@12.8.48 (100408-196123505):51)
at com.google.maps.api.android.lib6.drd.ap.a(:com.google.android.gms.dynamite_mapsdynamite@12848063@12.8.48 (100408-196123505):11)
at dw.a(:com.google.android.gms.dynamite_mapsdynamite@12848063@12.8.48 (100408-196123505):16)
at dw.run(:com.google.android.gms.dynamite_mapsdynamite@12848063@12.8.48 (100408-196123505):61)
Run Code Online (Sandbox Code Playgroud) 将我的项目升级到最新版本的Google Play服务(v4.0,在2013年万圣节发布)时,您现在应该在AndroidManifest.xml文件中添加新标记.
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
Run Code Online (Sandbox Code Playgroud)
不幸的是,当我尝试这样做时,我得到了这个编译错误:
android-apt-compiler: /blahblah/AndroidManifest.xml:409: error: Error: No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version').
Run Code Online (Sandbox Code Playgroud)
然后我可以导航到该文件google-play-services_lib/res/values/version.xml并查看该符号的原始整数:
<integer name="google_play_services_version">4030500</integer>
Run Code Online (Sandbox Code Playgroud)
然后将其插回我的AndroidManifest.xml:
<meta-data
android:name="com.google.android.gms.version"
android:value="4030500" />
Run Code Online (Sandbox Code Playgroud)
这样做非常好,我可以编译并运行项目和应用程序就好了.但它绝对是一个不可取的解决方案,具有明显的可升级性问题.
有任何想法吗?
我开发了自己的应用程序并通过Google Play发布了它以进行alpha测试.作为测试人员之一,我获得了一个选择加入链接,我作为测试人员登录.之后,我希望通过手机上的Play商店直接用我的手机下载应用程序.但似乎结果是,我必须到应用程序的网络配置文件,然后从那里点击下载; 只有这样Play商店才能将应用程序下载到我的手机上.
我想让其他alpha测试人员参与其中,我希望能让他们更轻松地完成这个过程.有没有更简单的方法?就像在,一旦他们选择加入,我希望他们只使用他们的Android手机下载应用程序,就像他们任何其他应用程序一样.有办法吗?
澄清:
我不是在寻找Google Play的替代品
我已经完成了Google Group创作过程.我的问题是关于团体成员选择加入后会发生什么.他们可以直接使用手机(在手机上播放应用程序)还是必须从网站上下载?到目前为止,我还没有成功使用play-app.
所以今天早上我开始更新到我的项目库的最新版本.
我正在尝试将GCM更新到最新版本9.2.0,但是我收到此错误:
错误:任务':app:processDebugGoogleServices'的执行失败.请通过更新google-services插件的版本来修复版本冲突(有关最新版本的信息,请访问https://bintray.com/android/android-tools/com.google.gms.google-services/)或将com.google.android.gms的版本更新为9.0.0.
这就是我的代码:
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.google.gms:google-services:3.0.0'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}
Run Code Online (Sandbox Code Playgroud)
然后:
dependencies {
...
compile "com.google.android.gms:play-services-gcm:9.2.0"
...
}
Run Code Online (Sandbox Code Playgroud)
任何人有同样的问题/修复同样的问题?
谢谢.
编辑
显然你必须在app/build.gradle文件的底部应用你的GSM插件.否则,版本9.2.0将导致项目冲突.
作为参考,这就是我的app/build.gradle文件现在的样子:
apply plugin: "com.android.application"
apply plugin: "com.neenbedankt.android-apt"
android {
...
}
dependencies {
...
// Google Cloud Messaging
compile "com.google.android.gms:play-services-gcm:9.2.0"
...
}
apply plugin: "com.google.gms.google-services"
Run Code Online (Sandbox Code Playgroud)