8.4.0 なのに「updating the version of com.google.android.gms to 8.3.0」

このように怒られ,

Execution failed for task ':app:processDebugGoogleServices'. Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 8.3.0.

build.gradle を見ると「8.4.0」

apply plugin: 'com.google.gms.google-services'
...
dependencies {
  ...
  compile 'com.google.android.gms:play-services-gcm:8.4.0'
  ...
}

こんな答えだと.

android - Version conflict updating to 8.4.0 - Stack Overflow

...
dependencies {
  ...
  compile 'com.google.android.gms:play-services-gcm:8.4.0'
  ...
}

// 最終行にもってくる
apply plugin: 'com.google.gms.google-services'

 

まとめ

build.gradle (project-top)

...
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        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
    }
}
...

build.gradle (app-module)

...
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    ...
    compile 'com.google.android.gms:play-services:8.4.0'
    ...
}
apply plugin: 'com.google.gms.google-services'

おつかれさまでした.

google-services_build_gradle_at_master_·_googlesamples_google-services

google-services/build.gradle


man は長すぎるので「tldr」

たとえば,

curl で JSON を POST したいとき,

オプション記述を覚えてないので man.

man_curl_—_80×24

長すぎて探すのが面倒で結局ぐぐってしまう.

ssh でポートフォワードしたいとき,

man_ssh_—_80×24

結局これもぐぐってしまう.

TLDR
【略】
=Too long. Didn't read.
長過ぎ。読みませんでした。/長文うざい(と言う人のための要約)。

そんな名前のすばやく調べるコマンドがありますよ.

bash_—_80×26

bash_—_81×28

分かりやすくうざくない長さで説明してくれます.

screenshot

tldr-pages/tldr

ちなみに「tldr」で「tldr」は以下.

tldr




Retrofit 2.0-beta で ログを吐かせる

Retrofit

Okhttp 2.6.0+ では HTTPリクエスト/レスポンスのログ出力が可能なのだが,

New Logging Interceptor. The logging-interceptor subproject offers simple request and response logging. It may be configured to log headers and bodies for debugging. It requires this Maven dependency:

HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
logging.setLevel(Level.BASIC);
client.networkInterceptors().add(logging);

okhttp/CHANGELOG.md at master · square/okhttp

残念なことに retrofit 2.0.0-beta2 での同梱は 2.5.0 .

<!-- Dependencies -->
<android.version>4.1.1.4</android.version>
<android.platform>16</android.platform>
<okhttp.version>2.5.0</okhttp.version>
<animal.sniffer.version>1.14</animal.sniffer.version>

retrofit/pom.xml at master · square/retrofit

なので logging-interceptor 2.6.0 で.

    <dependency>
      <groupId>com.squareup.okhttp</groupId>
      <artifactId>okhttp</artifactId>
      <version>${project.version}</version>
    </dependency>

okhttp/okhttp-logging-interceptor at master · square/okhttp

compile 'com.squareup.okhttp:logging-interceptor:2.6.0' 
HttpLoggingInterceptor logging = new HttpLoggingInterceptor();  
logging.setLevel(Level.BASIC);
OkHttpClient client = new OkHttpClient();  
httpClient.interceptors().add(logging);
Retrofit retrofit = new Retrofit.Builder()  
   .baseUrl(API_BASE_URL)
   .addConverterFactory(GsonConverterFactory.create())
   .client(httpClient)
   .build();

出力.

...
11:33:04.547 17090-17108 D/OkHttp: <-- HTTP/1.1 200 OK (469ms, 259-byte body)
11:33:04.550 17090-17296 D/OkHttp: --> GET /v5/item/1072964 HTTP/1.1
11:33:04.563 17090-17263 D/OkHttp: <-- HTTP/1.1 200 OK (250ms, 244-byte body)
11:33:04.566 17090-17108 D/OkHttp: --> GET /v5/item/1073510 HTTP/1.1
11:33:04.606 17090-17265 D/OkHttp: <-- HTTP/1.1 200 OK (252ms, 228-byte body)
11:33:04.609 17090-17263 D/OkHttp: --> GET /v5/item/1072585 HTTP/1.1
11:33:04.794 17090-17296 D/OkHttp: <-- HTTP/1.1 200 OK (244ms, 183-byte body)
11:33:04.796 17090-17265 D/OkHttp: --> GET /v5/item/1073275 HTTP/1.1

stable で対応するのかな.