0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[メモ] Android Studioで新規プロジェクト作成してビルドしたら転けた

Last updated at Posted at 2024-12-30

状況

  1. 新規プロジェクト作成
  2. ビルドボタン押す
  3. こける

エラー

2 issues were found when checking AAR metadata:
  1.  Dependency 'androidx.core:core:1.15.0' requires libraries and applications that
      depend on it to compile against version 35 or later of the
      Android APIs.
      :app is currently compiled against android-34.
      Recommended action: Update this project to use a newer compileSdk
      of at least 35, for example 35.
      Note that updating a library or application's compileSdk (which
      allows newer APIs to be used) can be done separately from updating
      targetSdk (which opts the app in to new runtime behavior) and
      minSdk (which determines which devices the app can be installed
      on).
  2.  Dependency 'androidx.core:core-ktx:1.15.0' requires libraries and applications that
      depend on it to compile against version 35 or later of the
      Android APIs.
      :app is currently compiled against android-34.
      Recommended action: Update this project to use a newer compileSdk
      of at least 35, for example 35.
      Note that updating a library or application's compileSdk (which
      allows newer APIs to be used) can be done separately from updating
      targetSdk (which opts the app in to new runtime behavior) and
      minSdk (which determines which devices the app can be installed
      on).
Update minCompileSdk in modules with dependencies that require a higher minCompileSdk.

内容

  • 使用しているライブラリのバージョンとプロジェクトの設定に不整合がある
  • androidx.core:core:1.15.0 と androidx.core:core-ktx:1.15.0 の両方が、Android API レベル 35 以上での実行を要求しているが現在のプロジェクトは API レベル 34 で設定している

結論

  • compileSdk を35に更新したらビルドできた
android {
    compileSdk 35  // 34から35に変更
    
    defaultConfig {
        // 他の設定はそのまま
    }
}

Android Studioくん、何もしてないのに初手でビルド転けるのやめてほしい
最初から35に向けといてくれよ...

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?