如何在没有拖放支持的Genymotion模拟器中安装Google Play服务?
我不能像Stack Overflow post中提到的那样安装它如何在Genymotion虚拟设备上安装Google框架(Play,Accounts等)?由于缺乏对拖放安装的支持.
Genymotion支持几个模拟器的Google Apps,但它不支持平板电脑模拟器.
我正在尝试使用新的Android Studio测试Google Play服务.我有一个与google_play_services.jar相关的项目.但是当我尝试重建项目时,我收到以下错误:
Information:[TstGP3-TstGP3] Crunching PNG Files in source dir: C:\Users\ans\AndroidStudioProjects\TstGP3\TstGP3\src\main\res
Information:[TstGP3-TstGP3] To destination dir: C:\Users\ans\AndroidStudioProjects\TstGP3\build\classes\res-cache\TstGP3-TstGP3
Information:Compilation completed with 2 errors and 0 warnings in 2 sec
Information:2 errors
Information:0 warnings
C:\Users\ans\.AndroidStudioPreview\system\compiler\tstgp3.3f17bd41\.generated\Android_BuildConfig_Generator\TstGP3-TstGP3.74fc5b25\production\com\example\tstgp3\BuildConfig.java
Error:Error:line (4)error: duplicate class: com.example.tstgp3.BuildConfig
C:\Users\ans\.AndroidStudioPreview\system\compiler\tstgp3.3f17bd41\.generated\aapt\TstGP3-TstGP3.74fc5b25\production\com\example\tstgp3\R.java
Error:Error:line (10)error: duplicate class: com.example.tstgp3.R
Run Code Online (Sandbox Code Playgroud)
它似乎有两个BuildConfig文件和两个R类.我该如何解决这个问题?
编辑:
我注意到编译器编译了两个R.java文件:一个位于我的项目文件夹中,另一个位于文件夹%USERPROFILE%.AndroidStudioPreview所以,我试图在编译器设置中排除这个"Preview"文件夹现在它正在发挥作用.只有在我的项目中开始使用Google Play服务类后,才会出现此问题.如果有人能解释这个问题背后的原因,我将不胜感激.
我有一个完全在Android Studio中开发的Android项目(目前版本为4.2,gradle版本为1.9-all).我想添加Google Play服务的功能.
项目无法解决GooglePlayServicesUtil,当我手动输入导入时(如下所示),我明白了Cannot resolve symbol 'common'.
import com.google.android.gms.common.GooglePlayServicesUtil;
Run Code Online (Sandbox Code Playgroud)
知道我需要做什么GooglePlayServicesUtil才能解决?
从Google Play服务设置中,我只需要将com.google.android.gms:play-services:4.+依赖项添加到我的build.gradle文件中(并使用gradle重新同步项目文件),以使SDK可用于我的项目.我确实得到了一个"爆炸的捆绑" ProjectName/module/build/exploded-bundles,但这似乎并没有成功.
我已经从SDK Manager安装了Google Play服务,Android支持存储库和Google Repository.我也删除并重新安装了多次:)
编辑:
我可能需要手动将google_play_services添加为项目/全局库吗?我试图没有成功.
我正在尝试验证我是否正在使用Google服务开发平台API(如果可能的话),但我不确定是不是这样.我没有改变似乎做任何事情.
我项目的外部库显示:
这是我的ProjectName/module/build.gradle文件:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.7.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
android {
compileSdkVersion 19
buildToolsVersion '19.0.1'
defaultConfig {
minSdkVersion 17
targetSdkVersion 19
versionCode 1 …Run Code Online (Sandbox Code Playgroud)