@Composable Scaffold で This material API is experimental and is likely to change or to be removed in the future.

Jetpack Compose で Material3 を使うと、


This material API is experimental and is likely to change or to be removed in the future.

で、ビルド通らず。

AndroidStudio が提案してくる対応としては以下。

@Composable Scaffold で This material API is experimental and is likely to change or to be removed in the future.

アノテーションを付けるのもアレですね。

gradle 側から一括無視しておきましょう。


kotlinOptions {
  allWarningsAsErrors = false
  freeCompilerArgs += [
      "-Xopt-in=kotlin.RequiresOptIn",
      "-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
      "-Xopt-in=kotlinx.coroutines.FlowPreview",
      "-Xopt-in=kotlinx.serialization.ExperimentalSerializationApi",
      "-Xopt-in=kotlin.Experimental"
  ]
}

👉 Opt-in requirement marker annotation on override requires the same marker on base declaration hatena-bookmark

少し将来に向けて修正。


'-Xopt-in' → '-opt-in'

👉 '-Xopt-in' is deprecated and will be removed in a future release, please use -opt-in instead hatena-bookmark

よって、今回のビルドエラーについてのみで言えば、以下で避けるのが良さげです。


freeCompilerArgs += '-opt-in=androidx.compose.material3.ExperimentalMaterial3Api'

この記述をどこに書くか。

対象が複数になるのを考慮して


freeCompilerArgs += [
    '-opt-in=androidx.compose.material3.ExperimentalMaterial3Api',
]

としておきます。

 

build.gradle (app) allprojects/subprojects {} 内


allprojects { // subproject {
  tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {

    kotlinOptions {
      allWarningsAsErrors = false
      freeCompilerArgs += [
          '-opt-in=androidx.compose.material3.ExperimentalMaterial3Api',
      ]
    }

  }
}

 

build.gradle (module) android {} 内


android {

  kotlinOptions {
    jvmTarget = JavaVersion.VERSION_11.toString()

    allWarningsAsErrors = false
    freeCompilerArgs += [
        '-opt-in=androidx.compose.material3.ExperimentalMaterial3Api',
    ]

  }

 

build.gradle (module) の最後


dependencies {
  // ...
  debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.9.1'
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {

  kotlinOptions {
    allWarningsAsErrors = false
    freeCompilerArgs += [
        '-opt-in=androidx.compose.material3.ExperimentalMaterial3Api',
    ]
  }

}

 

まとめ

プロジェクトの構成に合わせて、多少の拡張性を考慮しながら設定する必要があるでしょう。

👉 Opt-in requirements | Kotlin hatena-bookmark
👉 tachiyomi/build.gradle.kts at master · tachiyomiorg/tachiyomi hatena-bookmark


【macOS】横長ワイドなディスプレイで使いたいウィンドウマネージャーを探す

Split View で Mac の App を 2 つ並べて表示する
👉 Split View で Mac の App を 2 つ並べて表示する - Apple サポート (日本) hatena-bookmark

macOS 純正「Split View」は、なんとなくツラかったので、

いくつか入れてみました、無料のウィンドウマネージャー。

やりたかったのは、

「すばやくウィンドウを左右半分の大きさにして配置する」

ということです。

 

ShiftIt

インストールするといいかんじです。

Monterey でも問題なく動きます。

ShiftIt Managing window size and position in OSX
👉 fikovnik/ShiftIt: Managing windows size and position in OSX hatena-bookmark

しかし、リポジトリを見ると数年更新されていません。

This project is looking for a new maintainer. Until that transition is completed, there will likely not be further development on this project.

This project is looking for a new maintainer. Until that transition is completed, there will likely not be further development on this project.

今後、更新はされないかもしれない雰囲気です。

 

Spectacle

Move and resize windows with ease
👉 Spectacle hatena-bookmark
👉 eczarny/spectacle: Spectacle allows you to organize your windows without using a mouse. hatena-bookmark

しかし、このアプリもメンテナンス終了っぽいです。

This project is not being actively maintained.

代替として「Rectangle」なるものを推奨しています。

Spectacle users have recommended Rectangle as an open source alternative.

 

Rectangle

Rectangle: Move and resize windows on macOS with keyboard shortcuts and snap areas

当分これを使ってみることにします。

リポジトリも元気ですし、フォークやスターの数も多いです。

Rectangle: Move and resize windows on macOS with keyboard shortcuts and snap areas

👉 rxhanson/Rectangle: Move and resize windows on macOS with keyboard shortcuts and snap areas hatena-bookmark

このアプリも他のウィンドウマネージャーアプリと同様、以下のように

アクセシビリティアプリケーションにMacへのアクセスを許可する

アクセスの許可が必要になります。

👉 アクセシビリティアプリケーションにMacへのアクセスを許可する - Apple サポート (日本) hatena-bookmark

👉 多窓ブラウザは vivaldi が最強 hatena-bookmark


AGP Upgrade Assistant で 7.2 移行時にCause: manifestData.`package` must not be null

初回は、自動認識でダイアログから進むことになると思うが、

手動でやるなら以下から。


[Tools]

  ↓

[AGP Upgrade Assistant]

このステップでコケる。

Move package from Android manifest to build files

Declaration of a project's namespace using the package attribute of the Android manifest is deprecated in favour of a namespace declaration in build files.

なんすかねこれ。

 

Gradle sync failed: Cause: manifestData.`package` must not be null

Issue Tracker にありました。

AGP namespace property and app id suffix and Safe Args plugin don't work together

Using the new namespace property in build.gradle instead of the package attribute in AndroidManifest.xml while also using a custom applicationIdSuffix breaks androidx.navigation.safeargs plugin.

👉 Gradle sync failed: Cause: manifestData.`package` must not be null - Issue Tracker
👉 AGP namespace property and app id suffix and Safe Args plugin don't work together [232107688] - Visible to Public - Issue Tracker hatena-bookmark

どうやら、namespace の新記述は、

androidx.navigation.safeargs と同時に使えないようです。

使っているか、コード内を探してみました。


[Edit]

  ↓

[Find]

  ↓

[Find in Files ...]

androidx.navigation.safeargs

...

どうやら、ツールの書き換え内容は以下の様子。

👉 AndroidManifest の package 属性による名前空間宣言が廃止される - BattleProgrammerShibata hatena-bookmark

2行だけなので直接書き換えて namespace 記述は以前の形に戻す。と。

暫定的な対応なので、以下のようにFix版リリース時に注意が必要です。

👉 java.lang.IncompatibleClassChangeError: The method 'java.lang.Class java.lang.Object.getClass()' was expected to be of type interface but instead was found to be of type virtual hatena-bookmark


利用している Google Mobile Ads SDK (play-services-ads) のバージョンを確認する

👉 Google Play と Android の変更点に対応するためのアプリの準備 - Google AdMob ヘルプ hatena-bookmark


implementation com.google.android.gms:play-services-ads:x.y.z

20.4.0 (バージョン)
→ 広告IDの使用を継続するために自動的に権限が宣言されます。

20.5.0
→ オプトアウト済みユーザーのデータ収集と不正防止に対応するため、新しいアプリアセットIDに対応します。

20.6.0
→ tagForChildDirected(TFCD)または tagForUnderAgeOfConsent(TFUA)を通して子供向け取り扱いタグが付与された広告リクエストにおいては、広告IDが送信されないようにすることができます。

👉 Googleモバイル広告SDK  |  Android  |  Google Developers hatena-bookmark

現在、アプリで利用中のバージョンを build.gradle で確認してみたら、


com.google.android.gms:play-services-ads

がありません!

 

依存性を確認していく


./gradlew -q :app:androidDependencies  

...
release
releaseCompileClasspath - Dependencies for compilation
...
+--- com.google.android.play:core:1.10.3@aar
+--- com.google.android.gms:play-services-analytics:18.0.1@aar
+--- com.google.android.gms:play-services-oss-licenses:17.0.0@aar
+--- com.google.android.gms:play-services-tagmanager-v4-impl:18.0.1@aar
+--- com.google.android.gms:play-services-analytics-impl:18.0.1@aar
+--- com.google.firebase:firebase-messaging-ktx:23.0.4@aar
+--- com.google.firebase:firebase-messaging:23.0.4@aar
+--- com.firebaseui:firebase-ui-auth:8.0.1@aar
+--- com.google.android.gms:play-services-auth:19.0.0@aar
+--- com.google.firebase:firebase-ads:20.6.0@aar
+--- com.google.android.gms:play-services-ads:20.6.0@aar 👈
+--- com.google.android.gms:play-services-appset:16.0.0@aar
+--- com.google.firebase:firebase-auth-ktx:21.0.3@aar
+--- com.google.firebase:firebase-auth:21.0.3@aar
+--- com.google.android.gms:play-services-auth-api-phone:17.4.0@aar
+--- com.google.android.gms:play-services-safetynet:17.0.0@aar
+--- com.google.android.gms:play-services-auth-base:17.0.0@aar
+--- com.google.android.gms:play-services-base:18.0.1@aar
...

play-services-ads は、20.6.0 が、なぜか、見えますが。

さらに詳細を確認していきます。


./gradlew -q :app:dependencies --configuration releaseCompileClasspath

...
|         |         +--- com.google.android.gms:play-services-basement:17.0.0 -> 18.0.2 (*)
|         |         \--- com.google.firebase:firebase-annotations:16.0.0
|         \--- com.google.android.gms:play-services-measurement-sdk:21.0.0
|              +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*)
|              +--- com.google.android.gms:play-services-basement:18.0.0 -> 18.0.2 (*)
|              +--- com.google.android.gms:play-services-measurement-base:21.0.0 (*)
|              \--- com.google.android.gms:play-services-measurement-impl:21.0.0 (*)
+--- com.google.firebase:firebase-ads:20.6.0 👈
|    +--- com.google.android.gms:play-services-ads:20.6.0 👈
|    |    +--- androidx.browser:browser:1.0.0 -> 1.3.0
|    |    |    +--- androidx.core:core:1.1.0 -> 1.7.0 (*)
|    |    |    +--- androidx.annotation:annotation:1.1.0 -> 1.3.0
|    |    |    \--- com.google.guava:listenablefuture:1.0 -> 9999.0-empty-to-avoid-conflict-with-guava
|    |    +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*)
|    |    +--- androidx.core:core:1.0.0 -> 1.7.0 (*)
|    |    +--- com.google.android.gms:play-services-ads-base:20.6.0
...
(c) - dependency constraint
(*) - dependencies omitted (listed previously)
(n) - Not resolved (configuration is not meant to be resolved)

dependencies の記述の親子依存の調べ方

firebase-ads に依存されていますね。

もう一度、build.gradle を見てみます。


dependencies {
  ...
  implementation 'com.google.firebase:firebase-core:21.0.0'
  implementation 'com.google.firebase:firebase-ads:20.6.0' 👈
  implementation 'com.google.firebase:firebase-analytics-ktx:21.0.0'
  ...

つまりは、

play-services-ads の implementation 記述がなくても

firebase-ads から依存を追って解決されていってたのですね!!


【IDEA】typo チェックを無視する設定 元に戻したい リセットしたい【AndroidStudio】

おかしな単語をチェックしてくれる

IDEエディタってえらいです!

しかし、たまにその

「チェックを無視してほしい」

ときがありますが、これも

「右クリック」

から設定や編集できます。

【IDEA】typo チェックを無視する設定 元に戻したい リセットしたい【AndroidStudio】
以下の機能の利用が可能です。


Typo チェック機能を停止する

- process code
- process literals
- process comments


単語辞書に追加する

- dictionary project
- dictionary application


コードにアノテーションを付ける

- @file:Suppress("SpellCheckingInspection")
- @Suppress("SpellCheckingInspection")

まじ、えらいですね!

しかし、ここで言いたいのは、

これら右クリックから直感的に行ったTypo警告無視設定や対応を

「元に戻したい」

「リセットしたい」

ときはどうしたらいいのか、です。

 

Typo チェック機能を復活したい

Typo チェック機能を復活したい


Preferences

  ↓

Editor

  ↓

Inspections

  ↓

Proofreading 

  ↓

Typo

デフォルトから変更をしている場合は、

「Reset」 ボタン

も表示されます。

 

保存した辞書から消したい

保存した単語は編集できます。

保存した辞書から消したい


Preferences

  ↓

Editor

  ↓

Spelling

  ↓

Accepted Words

「承認する単語(Accepted Words)」は、

いつでも、この画面で、

追加・編集・削除 することができます。

 

まとめ

非常に機能の多くなった設定の検索もキーワードが分かりづらいときがあります。

今回の typo まわりの設定では、

設定の検索キーワードとしては、


typo


dictionary

ぐらいがよさそうです。


👉 ContentDescription を無視する - [Accessibility] Missing contentDescription attribute on image hatena-bookmark