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 5 years have passed since last update.

AndroidStudio3.6 Release実行時のNoSuchMethodException

Posted at
  • AndroidStudio 3.6 系が正式にリリースされましたね。
  • その際以下の問題に問題にぶちあたったので、情報を残しておきます。

問題動作

  • Android Studio 3.6 系にアップデート
  • Android StudioからのDebug実行は問題なく動作
  • Releaseビルドして実行
    • あれ?なんだか動かないぞ:frowning2:

問題点

  • アプリ起動時によくあるAPIからjson取得し、クラスオブジェクトに変換といった処理で以下のExceptionが出ている。
Caused by java.lang.NoSuchMethodException
parameter type is null

とりあえずの対策

  • jacksonMoshi といった JsonPerser のOSSで議論されており、現状の対応としては以下の対応を入れることで回避できました。
proguard-rules.pro
-keep class kotlin.Metadata { *; }

本対策は?

  • 使用しているOSSで議論されており、OSSの更新が必要なのか、R8を更新すれば問題が発生しなくなるのかは、検討中のようです。
  • 使用しているOSSの動向をチェックして対応していきましょう。

参考

https://github.com/square/moshi/issues/1049
https://medium.com/@AthorNZ/kotlin-metadata-jackson-and-proguard-f64f51e5ed32

それでは、楽しいアプリ開発を:dancer_tone1:

1
0
1

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?