1
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?

More than 1 year has passed since last update.

【Flutter】androidのデバッグをしようとしたらこけちゃった話

Posted at

androidでもエミュレータを使用してデバッグしようとしたら上手く立ち上がらない…困ったもんだ。

Execution failed for task ':app:mapDebugSourceSetPaths'

デバッグを実行したら、つらつらと下記の状態が流れてきた。
スクリーンショット 2024-03-22 15.07.30.png

んー、よくわからん。実行に失敗してるのは伝わるが、なにが良くないかさっぱりなので、検索してみる。

com.google.gms:google-servicesのバージョンを上げる

こちらのサイトに詳しく書かれていた。
依存関係の問題で、com.google.gms:google-servicesのバージョンを上げると解決する。

android/build.gradle

buildscript {
  dependencies {
    classpath 'com.android.tools.build:gradle:7.3.0'  
    // START: FlutterFire Configuration  
    // classpath 'com.google.gms:google-services:4.3.10' // ここを変更 
    classpath 'com.google.gms:google-services:4.3.14'  // 変更後
    // END: FlutterFire Configuration  
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  }
}

Execution failed for task ':app:compileDebugKotlin'.

上記を変更して、もう一度デバッグを実行したら今度は表題のエラーが発生。
内容は以下の通り。
スクリーンショット 2024-03-22 15.40.30.png

白枠の中を見てみると、Kotlinは最新バージョンが必要だから更新しなさいと書いているので、Kotlinの公式ドキュメントを確認しに行く。

そうすると、android/build.gradleに書かれているバージョンと最新のバージョンが違っていた。(投稿日時点での最新は1.9.23)
ので、その部分を変更してみる。
android/build.gradle

buildscript {
  // ext.kotlin_version = '1.7.10' //変更前
  ext.kotlin_version = '1.9.23' // 変更後
}

成功!

やったね!

スクリーンショット 2024-03-22 15.47.04.png

参考

1
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
1
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?