{"id":749,"date":"2023-07-25T07:10:07","date_gmt":"2023-07-25T07:10:07","guid":{"rendered":"https:\/\/www.devopssupport.in\/blog\/?p=749"},"modified":"2023-07-25T07:10:08","modified_gmt":"2023-07-25T07:10:08","slug":"flutter-minsdkversion-and-targetsdkversion-error","status":"publish","type":"post","link":"https:\/\/www.devopssupport.in\/blog\/flutter-minsdkversion-and-targetsdkversion-error\/","title":{"rendered":"Flutter minSdkVersion and targetSdkVersion error"},"content":{"rendered":"\n<p>In Flutter, the <code>minSdkVersion<\/code> and <code>targetSdkVersion<\/code> are attributes defined in the <code>AndroidManifest.xml<\/code> file. These attributes specify the minimum and target Android SDK versions that your app supports. When working with Flutter, you might encounter errors related to these attributes if they are not configured correctly.<\/p>\n\n\n\n<p>Here&#8217;s how you can resolve the <code>minSdkVersion<\/code> and <code>targetSdkVersion<\/code> errors<\/p>\n\n\n\n<p>Locate the <code>AndroidManifest.xml<\/code> file in your Flutter project. The file is usually located in the <code>android\/app\/src\/main<\/code> directory.<\/p>\n\n\n\n<p>Look for the <code>&lt;uses-sdk><\/code> element in the <code>AndroidManifest.xml<\/code> file. Within this element, you will find the <code>android:minSdkVersion<\/code> attribute. Make sure the value specified for <code>minSdkVersion<\/code> is compatible with the minimum Android version you want to support. For example, if you want to support Android 5.0 (API level 21) and higher, set the value as<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;uses-sdk\r\n    android:minSdkVersion=\"21\"\r\n    android:targetSdkVersion=\"30\" &lt;!-- Replace with your target SDK version -->\r\n\/>\r\n<\/code><\/pre>\n\n\n\n<p>In the same <code>&lt;uses-sdk><\/code> element, find the <code>android:targetSdkVersion<\/code> attribute. The <code>targetSdkVersion<\/code> specifies the Android SDK version against which your app is compiled and tested. It&#8217;s recommended to use the latest stable version available. Replace the value with the desired target SDK version, for example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;uses-sdk\r\n    android:minSdkVersion=\"21\" &lt;!-- Replace with your min SDK version -->\r\n    android:targetSdkVersion=\"31\" &lt;!-- Replace with your target SDK version -->\r\n\/>\r\n<\/code><\/pre>\n\n\n\n<p>Save the changes made to the <code>AndroidManifest.xml<\/code> file and rebuild your Flutter project. You can run <code>flutter clean<\/code> to clean any previous build artifacts and then run <code>flutter build<\/code> to rebuild your app.<\/p>\n\n\n\n<p>Ensure that the SDK versions you set for <code>minSdkVersion<\/code> and <code>targetSdkVersion<\/code> are compatible with the Flutter SDK version you are using. Check the Flutter documentation or release notes for compatibility information. It&#8217;s essential to choose appropriate SDK versions for <code>minSdkVersion<\/code> and <code>targetSdkVersion<\/code>. Setting the <code>minSdkVersion<\/code> too high may limit the number of devices your app can run on, while setting the <code>targetSdkVersion<\/code> too low may prevent you from accessing the latest Android features and optimizations.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Flutter, the minSdkVersion and targetSdkVersion are attributes defined in the AndroidManifest.xml file. These attributes specify the minimum and target Android SDK versions that your app supports&#8230;. <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-749","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts\/749","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/comments?post=749"}],"version-history":[{"count":1,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts\/749\/revisions"}],"predecessor-version":[{"id":750,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts\/749\/revisions\/750"}],"wp:attachment":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/media?parent=749"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/categories?post=749"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/tags?post=749"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}