LoginSignup
0
0

AndroidのJUnitテストは超ムズい(7)

Posted at

Robolectric-4.11.xがリリースされた

以前に、compileSdk = 34だと、Robolectricが対応していなくて、localテストが動かないという記事を書きました。

昔からそうなんですが、googleはこのcompileSDKのAPIレベルのハードルをどんどん上げてきます。開発者をできるだけ最新のAPIレベルに誘導しようとします。

Robolectricに限らず他の依存ライブラリも、AndroidSdudioの推奨する通りバージョンを上げていくと、gradle同期の時にcompileSdk = 34を要求されます。

Robolectricも先月、10/29にやっと、4.11がリリースされ、compileSdk = 34に対応しました。

image.png

これで、このエラーは出なくなります。

Package targetSdkVersion=34 > maxSdkVersion=33
	at org.robolectric.RobolectricTestRunner.getChildren(RobolectricTestRunner.java:259)
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