Dear developers,
After you upgrade to the latest CameraX releases (1.0.0-alpha30 or better), you will need to use the stable SDK 31 (or better) to compile your application; otherwise you may experience an error like this:
To fix it, simply change your compileSdkVersion to 31. The requirement does not affect your minSdkVersion or targetSdkVersion settings. This is because AndroidX enforces the minCompileSdk metadata flag: after the latest SDK for an Android version is finalized, AndroidX updates the minCompileSdk to that SDK version. We will also add this in the release note to ensure it is well communicated in the future.
Thank you for continuously supporting CameraX!
Julie on behalf of CameraX development team