@@ -82,6 +82,96 @@ Step 2. On your root build.gradle, add mavenCentral() to the allprojects section
8282 implementation 'io.github.tutorialsandroid:kalertdialog:20.5.15'
8383 implementation 'io.github.tutorialsandroid:progressx:7.0.5' //required for kalertdialog lib
8484 }
85+
86+ ## ⚠️ Important: compileSdk Requirement
87+
88+ Starting from the latest versions of ** KAlertDialog** and ** ProgressX** , this library is built with the latest Android SDK.
89+
90+ If you are using:
91+
92+ ``` gradle
93+ implementation 'io.github.tutorialsandroid:kalertdialog:20.5.15'
94+ implementation 'io.github.tutorialsandroid:progressx:7.0.5'
95+ ````
96+
97+ your app must compile against **Android API 37 or higher**.
98+
99+ ### Required configuration
100+
101+ In your app-level `build.gradle`, make sure your `compileSdk` is set to **37** or higher:
102+
103+ ```gradle
104+ android {
105+ compileSdk 37
106+
107+ defaultConfig {
108+ minSdk 23
109+ targetSdk 36
110+ }
111+ }
112+ ```
113+
114+ For Kotlin DSL:
115+
116+ ``` kotlin
117+ android {
118+ compileSdk = 37
119+
120+ defaultConfig {
121+ minSdk = 23
122+ targetSdk = 36
123+ }
124+ }
125+ ```
126+
127+ ### Why is this required?
128+
129+ If your project is using an older ` compileSdk ` , for example:
130+
131+ ``` gradle
132+ compileSdk 36
133+ ```
134+
135+ you may see an error like this:
136+
137+ ``` txt
138+ Dependency 'io.github.tutorialsandroid:kalertdialog:20.5.15' requires libraries and applications
139+ that depend on it to compile against version 37 or later of the Android APIs.
140+
141+ :app is currently compiled against android-36.1.
142+ ```
143+
144+ This happens because the latest version of KAlertDialog and ProgressX is compiled with ** Android API 37** .
145+
146+ ### Important note
147+
148+ Updating ` compileSdk ` is safe and different from updating ` targetSdk ` or ` minSdk ` .
149+
150+ * ` compileSdk ` allows your app to compile with the latest Android APIs.
151+ * ` targetSdk ` controls which Android runtime behavior changes your app opts into.
152+ * ` minSdk ` controls the minimum Android version your app can be installed on.
153+
154+ So you can update only ` compileSdk ` to 37 while keeping your existing ` targetSdk ` and ` minSdk ` .
155+
156+ ### Solution
157+
158+ Update your app-level Gradle file:
159+
160+ ``` gradle
161+ android {
162+ compileSdk 37
163+ }
164+ ```
165+
166+ Then sync the project again in Android Studio.
167+
168+ If Android Studio asks to install Android API 37, install it from:
169+
170+ ``` txt
171+ Tools > SDK Manager > Android SDK
172+ ```
173+
174+ After updating ` compileSdk ` , the AAR metadata error should be resolved.
85175
86176## Usage
87177
0 commit comments