Home > OS >  minCompileSDK specified in dependency AAR metadata (androidx.window:window:1.0.0-beta04)
minCompileSDK specified in dependency AAR metadata (androidx.window:window:1.0.0-beta04)

Time:02-23

I'm currently using Android studio attempting to run an old Flutter project I made about a year and a half ago. When I attempt to run it I get the error:

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.window:window-java:1.0.0-beta04.\

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.window:window:1.0.0-beta04.

I am aware of similar questions having been asked and answered, but there is a key difference. The answer to these questions is to force gradle to use an older version of the package, yet as far as I have been able to figure out 1.0.0 is the lowest version of these dependencies.

I thought I could perhaps just remove the dependencies, but I'm not sure if I need them or how to even do that, but I cannot use an older version.

Currently my minSdkVersion is 21 and my targetSdkVersion as well as compileSdkVersion is 30. I tried just raising these numbers to 31 and 32, but that brought other issues up that I was not able to solve.

What are my options here? Can I remove the packages somehow? Should I upgrade to SDK 31 somehow?

CodePudding user response:

This is an interesting library to work with the Android framework.

So My answer is twofold.

  1. THis library is for the foldable phones that are being introduced right now. This library's APIs are a little bit different than other APIs if you want to use them. Some companies that make foldable phones use these APIs to make foldable phone-specific apps. Due to this API usage, you need to increase the SDK version inside the build.Gradle inside the app folder(App Level) file. These APIs are only supported by the higher version of the android version. (These APIs are released in 2022).

    In the Android documentation, it says the minimum SDK is 14 but that's not the case. In the Microsoft documentation, it says compiled SDK is 31. Microsoft documentation

  2. If you haven't installed the SDK files inside the android studio, You can download them in the SDK. And upgrade the version of compiled SDK version.

Seems like you have two choices. Either you can compile the 31 version and it won't work on the previous SDKs

Or

You can delete the functionality or plugin that uses that API to support the multiple SDKs.

CodePudding user response:

you need to decrease dependency versions which will be compatible with compile sdk 30.

  • Related