Pixel 7/7 Pro を購入するときの iPhone/Pixel シリーズ下取り価格一覧 (2022-10-08 18:00 現在)

1世代前のPixel 3が¥11,924 – ¥15,000、1世代先のPixel 5が¥49,805 – ¥61,500、Pixel 6およびPixel 6 Proが¥42,431 – ¥61,500で、最低額が最も高く設定されているのが3年前に発売された機種というあまりにも不自然な値段設定です。

👉 Pixel 7発売でPixel 4の下取り額が最大61,500円に爆上げ。中古スマホ店やメルカリから姿を消す hatena-bookmark


iPhone 6           ¥7,108 -  ¥9,380
iPhone 6 Plus      ¥7,176 - ¥10,100
iPhone 6S          ¥6,244 - ¥12,260
iPhone 6S Plus     ¥7,522 - ¥12,550
iPhone 7           ¥8,584 - ¥13,650
iPhone 7 Plus     ¥10,298 - ¥18,600
iPhone 8           ¥8,703 - ¥19,800
iPhone 8 Plus     ¥12,962 - ¥24,816
iPhone SE          ¥5,767 -  ¥9,250
iPhone SE2        ¥21,906 - ¥35,000
iPhone X          ¥12,072 - ¥25,900
iPhone XR         ¥14,614 - ¥29,202
iPhone XS         ¥14,357 - ¥33,600
iPhone XS Max     ¥22,351 - ¥40,600
iPhone 11         ¥41,885 - ¥61,500 *
iPhone 11 Pro     ¥36,876 - ¥61,500
iPhone 11 Pro Max ¥30,124 - ¥63,558
iPhone 12         ¥38,045 - ¥61,500
iPhone 12 Mini    ¥41,033 - ¥61,500
iPhone 12 Pro     ¥40,421 - ¥74,745
iPhone 12 Pro Max ¥46,777 - ¥84,915


Pixel          ¥6,469 -  ¥8,000
Pixel XL       ¥6,469 -  ¥8,000
Pixel 2        ¥5,903 -  ¥8,000
Pixel 2 XL     ¥5,165 -  ¥8,000
Pixel 3       ¥11,924 - ¥15,000
Pixel 3 XL    ¥11,211 - ¥15,000
Pixel 3a      ¥18,174 - ¥22,000
Pixel 3a XL   ¥17,462 - ¥22,000 
Pixel 4       ¥53,809 - ¥61,500 *
Pixel 4 XL    ¥52,347 - ¥61,500
Pixel 4a       ¥8,765 - ¥17,600
Pixel 4a 5G    ¥9,401 - ¥17,600
Pixel 5       ¥49,805 - ¥61,500
Pixel 5a (5G) ¥14,284 - ¥35,768
Pixel 6       ¥42,431 - ¥61,500
Pixel 6 Pro   ¥42,431 - ¥61,500

Pixel7-iPhone11
👉 Google Pixel 7 - Google ストア hatena-bookmark

このチャンスを見逃すな?!



👉 最新 Android Pixel7 端末をお得に購入するための3つのこと。 hatena-bookmark
👉 軽くて小さくて新しいスマホを買いたい iPhone14 vs Pixel7 hatena-bookmark


【Jetpack Compose】「Layout Inspector Recomposition counts」で re-compose 回数を確認する

Jetpack Compose を使っていると、

いつ、どの composable が、 compose されているか、

パフォーマンスが重ければ重いほど気になります。

確認してみましょう。

 

Layout Inspector

すごく便利そうな AndroidStudio の機能です。

【 Jetpack Compose】Layout Inspector Recomposition counts

👉 Compose のパフォーマンス  |  Jetpack Compose  |  Android Developers hatena-bookmark


[Tools]

  ↓

[Layout Inspector]

 

利用条件

端末側で設定が必要です。


表示属性検査を有効にする

【 Jetpack Compose】Layout Inspector Recomposition counts

👉 Compose のツール  |  Jetpack Compose  |  Android Developers hatena-bookmark

R8 などは OFFにする。


debug {
  minifyEnabled false // for layout inspector
  proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}

あと、一番ネックになるのがこれ。

This is only available in Electric Eel at the moment:

"For even more cutting edge features, you can take a sneak peek at the Android Studio Electric Eel release in the Canary channel [...] These features will be promoted to more stable channels once we have your feedback and make improvements, so please try them out."

👉 android - Jetpack Compose: The layout inspector is not showing the menu for recomposition counts - Stack Overflow hatena-bookmark


Android Studio Electric Eel release in the Canary channel

今はまだ、非Statble な「Android Studio Electric Eel」でしか使えないようです。

JetBrains の「Toolbox」を使っていれば問題ありません。

JetBrains Toolbox で Android Studio の Stable/Beta/Canary が同時に管理できる?

使ってない人は、すぐインストールしておきましょう。

👉 JetBrains Toolbox で Android Studio の Stable/Beta/Canary が同時に管理できる? hatena-bookmark

 

結果

左下に Layout Inspector が開いたら以下。


[Component Tree]

  ↓

[View Option]

  ↓

[Show Recomposition counts]

compose counts

ヘビーな LazyVerticalGrid でやってみました。

re-compose されると、その部分が赤く変色します。



しかしこれ、

重すぎやせんか、ツールとして。

しかも、よく落ちる。

今後、期待しています。

👉 「Compose Compiler Reports」 recompose される条件とタイミングと範囲を知りたい hatena-bookmark
👉 【Jetpack Compose】LazyVerticalGrid - Profile GPU Rendering / Profile HWUI rendering - YouTube hatena-bookmark


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

'-Xopt-in' is deprecated and will be removed in a future release, please use -opt-in instead
👉 Issues with Gradle Kotlin DSL and `-Xopt-in` deprecation : KT-51708 hatena-bookmark


tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
   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",
     ]
   }
 }


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


tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
   kotlinOptions {
     allWarningsAsErrors = false
     freeCompilerArgs += [
         "-opt-in=kotlin.RequiresOptIn",
         "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
         "-opt-in=kotlinx.coroutines.FlowPreview",
         "-opt-in=kotlinx.serialization.ExperimentalSerializationApi",
         "-opt-in=kotlin.Experimental",
     ]
   }
 }

単純に gradle ファイル内、文字列の置換で完。

コード内アノテーションで利用の人はそのままでいいんかな。

👉 Opt-in requirement marker annotation on override requires the same marker on base declaration  hatena-bookmark
👉 AGP Upgrade Assistant で 7.2 移行時にCause: manifestData.`package` must not be null hatena-bookmark
👉 @Composable Scaffold で This material API is experimental and is likely to change or to be removed in the future. 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


This version (1.2.0-alpha08) of the Compose Compiler requires Kotlin version 1.6.20 but you appear to be using Kotlin version 1.6.21 which is not known to be compatible.

こんなの出ましたけどー。


> Run with --scan to get full insights.


> Task :app:compileDebugKotlin FAILED
e: This version (1.2.0-alpha08) of the Compose Compiler requires Kotlin version 1.6.20 but you appear to be using Kotlin version 1.6.21 which is not known to be compatible.  Please fix your configuration (or `suppressKotlinVersionCompatibilityCheck` but don't say I didn't warn you!).

言われるがままに、kotlin のバージョンを、1.6.20 に下げればこのエラーは消えてビルド通りますが、

Kotlin 安定版の 1.6.21 を 1.6.20 を下げる

ってのどうなのと。

 

Compose コンパイラ と Kotlin の互換性


Compose Compiler	Compatible Kotlin
1.2.0-alpha08		1.6.20
1.2.0-alpha07		1.6.10
1.2.0-alpha06		1.6.10

以下から、英語版 (言語を「English」に切り替える) にすると分かりやすいです。

👉 Compose to Kotlin Compatibility Map  |  Android Developers hatena-bookmark

Kotlin stable 1.6.21 に対応する Compose Compiler は 今現在は pre-release 版しかありません。


 

何でこんなことになるのか?


通常、安定版とアルファ版の両方が同じ日に修正された状態でリリースされると思われます。しかし、AndroidXのモノレポとその関連インフラは、実はこれを阻んでいます。リリースブランチが一つしかないので、Accompanist のような通常のプロジェクトとは異なり、別々に行うことを余儀なくされるのです。


Kotlin 1.6.20のアーティファクトがリリースされてから1週間。ComposeをアップデートするCLはリリース前にできていた。しかし、AndroidXのモノレポでは、無関係な50のライブラリを同時にアップデートすることを強制されるため、未だに不完全です。健全なプロジェクトであれば、同じ日にリリースするはずです。

Drop "androidx" from Jetpack Compose package name, for multiplatform, before 1​.​0 release.
👉 キャンペーン · Drop "androidx" from Jetpack Compose package name, for multiplatform, before 1​.​0 release. · Change.org hatena-bookmark

Compose コンパイラを開発する環境にいろいろ問題とかあるんですかね。

👉 公式 android デベロッパー の英語ページに日本語ページが遅れてる件 hatena-bookmark

 

2022-05-21 追記

1.6.21 対応の beta版がリリースされています。

compose の父が!


これも「English」ページのみ確認できます。注意です!
kotlinCompilerExtensionVersion = "1.2.0-beta02"

👉 Compose to Kotlin Compatibility Map  |  Android Developers hatena-bookmark