0
0

More than 1 year has passed since last update.

AndroidでのJava→Kotlin移行時に起動すると異常終了するようになった場合の対処法

Posted at

Javaファイル右クリック → Convert Java File to Kotlin File

このままだと変換は無事終了するが、起動時に以下のエラーが出て異常終了してしまう。

Caused by: java.lang.ClassNotFoundException: Didn't find class "com.xxxxx.xxxxxxx.XxxXxxxxx" on path: DexPathList[[zip file

javaディレクトリ右クリック → Convert Java File to Kotlin File

こちらだと、以下の確認ダイアログが表示される。

Kotlin is not configured in the project
You will have to configure Kotlin in project before performing a conversion.

OK, configure Kotlin in the projectを選ぶと、build.gradleapp/build.gradleにもdependenciesなどの必要な設定が自動的に追加される。

compileSdkVersionを上げるよう指示があれば、それに従う。

これで異常終了することは無くなる。

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