LoginSignup
2
0

Update this project to use a newer compileSdk of at least , for example 解決方法

Last updated at Posted at 2023-11-14

エラー内容
Recommended action: Update this project to use a newer compileSdk of at least 34, for example 34.
推奨されるアクション このプロジェクトを更新して、少なくとも34(たとえば34)の新しいcompileSdkを使用してください。

解決法

Android Studio で以下のファイルを開く
C:\Users\<ユーザー名>\AndroidStudioProjects\<アプリケーション名>\app 内の build.gradle.kts (Module :app)

build.gradle.kts (Module :app) ファイルの androidの個所を編集する。

android {
namespace = "com.example.myapplication"
compileSdk = 34

※今回は事例として 34 にしたが今後新バージョンが出ると 35, 36,, と数字は更新されるので最新バージョンの番号は各自で要確認。2023年11月15日現在では34にアップデートしろというメッセージが出る。

defaultConfig の箇所も同様に 34 に書き換えたい。
defaultConfig {
///その他の項目////
targetSdk = 34

すると defaultConfig のtargetSdk = 34の箇所に下線が出現し下線にマウスポインタを当てると「sdkをアップデートしますか?」という吹き出しが表示される。more actions クリックし、sync now をクリックする。

アップデート後このエラーは出現せず解決できアプリケーションが動作した。

バージョン
Android Studio Giraffe | 2022.3.1
Windows 11 Home

2
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
2
0