相关疑难解决方法(0)

google-services.json用于不同的productFlavors

更新: 不推荐使用GCM,请使用FCM

我实施新的谷歌云消息之后从谷歌开发者页面的导游在这里

我已成功运行并测试它.但我现在的问题是我有不同的productFlavors具有不同的applicationId/packageName和不同的GCM项目ID.在google-services.json具有在被投入/app/google-services.json不是味道文件夹.

有没有办法让google-services.json配置与许多口味不同?

android google-cloud-messaging google-play-services

430
推荐指数
13
解决办法
10万
查看次数

错误"模块根文件夹中缺少文件google-services.json.没有它,Google Services插件无法正常运行"

我将我的项目更新为最新的Play服务classpath 'com.google.gms:google-services:1.5.0-beta2'.我也在app.gradle文件中使用最新版本的playservices:

compile 'com.google.android.gms:play-services-location:8.3.0'
compile 'com.google.android.gms:play-services-gcm:8.3.0'
Run Code Online (Sandbox Code Playgroud)

但是当我编译时,Gradle会抛出异常,如下所示

Error:Execution failed for task ':app:processDebugGoogleServices'. > File google-services.json is missing from module root folder. The Google Services Plugin cannot function without it.
Run Code Online (Sandbox Code Playgroud)

android google-play-services android-gradle-plugin

147
推荐指数
9
解决办法
25万
查看次数

50
推荐指数
5
解决办法
4万
查看次数

com.android.builder.testing.ConnectedDevice> hasTests [test(AVD) - 5.0] FAILED

我尽力用gradle测试我的android项目,但失败了.你可以帮帮我吗?谢谢.这是我的项目:https: //github.com/SnowdreamFramework/android-log ,我提供了我的错误日志与附件.

[0K$ echo no | android create avd --force -n test -t android-21 --abi armeabi-v7a
Android 5.0 is a basic Android platform.
Do you wish to create a custom hardware profile [no]Created AVD 'test' based on Android 5.0, ARM (armeabi-v7a) processor,
with the following hardware config:
hw.cpu.model=cortex-a8
hw.lcd.density=240
hw.ramSize=512
vm.heapSize=48
travis_time:end:0d68df50:start=1416651329874810477,finish=1416651333337412612,duration=3462602135
[0Ktravis_fold:end:before_script.4
[0Ktravis_fold:start:before_script.5
[0Ktravis_time:start:15d80c70
[0K$ emulator -avd test -no-skin -no-audio -no-window &
travis_time:end:15d80c70:start=1416651333347425441,finish=1416651333353869405,duration=6443964
[0Ktravis_fold:end:before_script.5
[0Ktravis_fold:start:before_script.6
[0Ktravis_time:start:01e4ff4d
[0K$ android-wait-for-emulator
Creating filesystem with parameters:
    Size: 69206016
    Block size: …
Run Code Online (Sandbox Code Playgroud)

testing android gradle travis-ci

11
推荐指数
1
解决办法
6955
查看次数