Gradle Dependency バージョンのチェックを「最新」に更新する方法

便利そうなのでました!

Android Developers Blog: Announcing new SDK versioning in Google Play services and Firebase

com.google.android.gms:play-services-*
com.google.firebase:firebase-*

に関しては、それぞれが独立したバージョンで記述してよい。

なので、以下のような「バージョンをを揃える」記述は不要。


buildscript {
    ext {
        play_version = '15.0.0'
    }
}

dependencies {
    // DON'T DO THIS!!
    // The following use of the above buildscript property is no longer valid.
    implementation "com.google.android.gms:play-services-auth:${play_version}"
    implementation "com.google.firebase:firebase-auth:${play_version}"
    implementation "com.google.firebase:firebase-firestore:${play_version}"
}

利用方法は以下2パターン。


classpath 'com.google.gms:google-services:3.3.0'

// 最終行
apply plugin: 'com.google.gms.google-services' 

かまたは、


classpath 'com.google.android.gms:strict-version-matcher-plugin:1.0.0'

// 最終行
apply plugin: 'com.google.android.gms.strict-version-matcher-plugin'

とのこと。

 

やってみたが...

エラー。

ビルドできず。


The library com.google.android.gms:play-services-measurement-base
is being requested by various other libraries at [[15.0.0,15.0.0], [15.0.2,15.0.2]],
but resolves to 15.0.2. Disable the plugin and check your dependencies tree
using ./gradlew :app:dependencies.

記述にはない「play-services-measurement-base」が

内部的に呼ばれてこけている。

メッセージに書いてある


./gradlew :app:dependencies

は実行すらできない。

それぞれは、Andrid Studioの自動チェックで最新のはずなのだが。

 

それぞれのバージョンを確認してみる

目視でGoogleリポジトリを確認。

Google's Maven Repository

AndroidStudioの自動チェックで最新版の「15.0.0」だと思っていたが

実は、古いバージョンのままだった。

実際は「15.0.2」が最新。

これに書き換えたらいけた。

しかし、AndroidStudioの自動最新バージョンチェック機能らしきは、

機能してなくね?

かまたは、微妙に古くね?

 

Lint「Newer Library Versions Available」 を確認する

「Preference」-「Editor」-「Inspections」 にある

「Lint」-「Newer Library Versions Available」

OFFになってるが。

Description
Newer Library Versions Available This detector checks with a central repository to see if there are newer versions available for the dependencies used by this project. This is similar to the GradleDependency check, which checks for newer versions available in the Android SDK tools and libraries, but this works with any MavenCentral dependency, and connects to the library every time, which makes it more flexible but also much slower.

「毎回チェックするのでとろい」ということで

デフォルトでOFFになっているのか。

毎回でなく適時、意図的に実行したい場合は、

「Analyze」-「Run Inspection by Name」からいきましょう。

 

グレーのハイライトと同時にツールチップで最新版である

「15.0.2」

をサジェストしてくれました!

【Android Studio】ビルド環境を安定した最新バージョンにする


入力文字の 日本語 と 英数記号 切り替えをシンプルにする設定

もうこれずっと気にはかかってたのだけども、

思い通りにできるようなできないような。

なんとなく偶然でボタンを押しながら切り替えてました。

なので、スムーズにいくはずもなく、長文だとイライラしてくる。

今回、Google「Gboard」が日本語対応しているということで、

それに乗り換えるついでに、

少し整理して解決しておこうと思いました。

Gboard - the Google Keyboard - Apps on Google Play

Gboardの「言語切り替えキー」をフル活用して、

結果、以下でいいんじゃね的なとりあえずまとめ。

 

OS側の設定

Android端末自体の設定です。

切り替えをスムーズに行うために

不要なキーボードアプリはOFFにしておくとよいです。

「設定」-「言語と入力」-「仮想キーボード」-「キーボードを管理」

というかアンインストールすればさらにスッキリするっちゃあする。

あと、「入力方法の選択のアイコン」もOFFにしておく。

「設定」-「言語と入力」-「入力方法選択のアイコン」

これは、キーボードアプリの切り替えのためのものだが、

Gboardの「言語切り替えキー」とダブる。

 

Gboard側の設定

Gboardは多言語で複数の種類のキーボード形式を同梱しています。

私の場合は、

日本語 - 12キー(フリック)
英数記号 - qwertyキー

で入力したいのでそれに合わせて設定します。

「Gboard」-「設定」-「言語」

あと、「言語切り替えキーを表示」をONにしておきます。

「Gboard」-「設定」-「設定」

 

使い方

日本語と英数記号のキーボード切り替えは

すべて地球マークの「言語切り替えキー」で行います。

また、他のキーボードアプリを利用したい場合も

OS側の設定で有効にしておけばこれで切り替えできます。

これで意図通りに切り替えることができます。

地球マークを押せば

日本語と英数記号のキーボードを

行ったり来たりできます。

地球マークが表示されないときは、記号やテンキーモードなので

左下のそれらしいキーを押してみましょう。

 

設定変更以外に「長押し」は必要ありません。

混乱します。

 

まとめ?

「キーボード自体」の切り替えについては以下。
→ Android 端末 キーボード切り替え方法あれこれ

言語切り替えキーのみで日-英数記号キーボード切り替え

切り替えに長押しは不要

最近のスマホやアプリはもうややこしすぎて嫌になります。

不要な機能はガンガンOFFにしてみましょう!

「捨てる能力」大事です。

あの Jake Wharton さんが伝授する Android Studio を高速化する方法

顔文字パック キーボード - Google Play のアプリ

追記 2019-11-25

今となっては以下が有効です。

👉 【Gboard】QWERTYキーが3種類あってはまる件【日本語入力】 

12キーの日本語入力に加えて、英数文字はグライド入力を使って、快速に文字入力していきましょう!!


【質問です】こんなの表示されて消えないのですがこのスマホはコインマイニングに利用されているのでしょうか?

通知バーから、こんなダイアログがこんなダイアログが表示されてるのですが、英語が分かりません。

Google翻訳で翻訳してみます。

LineaGenuine

This device is uncertified and it didn't pass the validation.
In order to avoid malicious usage of the device's resources, LOSCoins will be mined on this device.

LineaGenuine

このデバイスは認証されておらず、検証に合格しませんでした。
デバイスのリソースの悪意のある使用を避けるため、LOSCoinはこのデバイスでマイニングされます。

先日、Googleが Uncertified な端末は排除するとかアナウンスしてましたよね。

端末の登録

...

...

え!

誰が勝手にマイニングしとんねんな!

「No」や「Cancel」を押してみると

え!

怖くなってググります。

LineaGenuine (both 15.1 and 14.1)
Our new tool allows you to feel more comfortable knowing whether you’re running a certified build. In case the device is caught running an uncertified OS, this tool will warn the user and some measures will be taken in order to guarantee you the device’s resources aren’t being misused.
If you want to disable the persistent notification, run this command from a root shell (such as adb root / recovery or terminal app) setprop persist.lineage.nofool true and reboot the device

Changelog 17 - Building Blockchains, Genuine Guarantee, and Lucky Lock – LineageOS – LineageOS Android Distribution

どうやら、エイプリルフールネタのようです。

setprop persist.lineage.nofool true && stop && start

LOSCoins on my device? Yes/No : LineageOS

ネタで良かったです。

ちなみに、Googleに認証されている端末かどうかを確認するには、「PlayStore」アプリから、

「設定」-「端末の認証」

です。

今年もよろしくおねがいします。