I am exploring compose navigation as specified in the docs.
Adding the dependency with version 2.4.0-alpha07
as specified in docs, gives the following error,
Error 1
One or more issues found when checking AAR metadata values:
The minCompileSdk (31) specified in a dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties) is greater than this module's compileSdkVersion (android-30). Dependency: androidx.navigation:navigation-compose:2.4.0-alpha07. AAR metadata file: /Users/abhimanyu/.gradle/caches/transforms-3/0575ff5712e0a9c15b8d7424501c07b8/transformed/jetified-navigation-compose-2.4.0-alpha07/META-INF/com/android/build/gradle/aar-metadata.properties.
This error forces me to upgrade compileSdkVersion
and targetSdkVersion
of my app from 30 to 31.
Upgrading the version gives this error,
Error 2
Manifest merger failed: Apps targeting Android 12 and higher are required to specify an explicit value for
android: exported
when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
To solve that, checked this post.
Even after adding the android:exported
, I am getting the same error (error 2).
Is the compileSdkVersion
upgrade to 31 mandatory?
If yes, how to solve Error 2. If no, how to solve Error 1?
I personally prefer to stick with SDK 30 if possible.