{"id":771,"date":"2023-07-26T06:21:29","date_gmt":"2023-07-26T06:21:29","guid":{"rendered":"https:\/\/www.devopssupport.in\/blog\/?p=771"},"modified":"2023-07-27T06:25:26","modified_gmt":"2023-07-27T06:25:26","slug":"error-failed-to-parse-xml-in-androidmanifest-xml","status":"publish","type":"post","link":"https:\/\/www.devopssupport.in\/blog\/error-failed-to-parse-xml-in-androidmanifest-xml\/","title":{"rendered":"Error &#8220;Failed to parse XML in AndroidManifest.xml&#8221;"},"content":{"rendered":"\n<p>The error message you provided indicates the same issue as before: the <code>minSdkVersion<\/code> should not be declared directly in the AndroidManifest.xml file. To fix this issue, follow the steps mentioned in the previous response:<\/p>\n\n\n\n<p>Open your project in Android Studio. Navigate to the <code>AndroidManifest.xml<\/code> file located at the path mentioned in the error message: <code>C:\\Users\\avina\\AndroidStudioProjects\\mhn_app_doctor\\android\\app\\src\\main\\AndroidManifest.xml<\/code>.<\/p>\n\n\n\n<p>In the <code>AndroidManifest.xml<\/code> file, locate the <code>&lt;uses-sdk><\/code> element that contains the <code>minSdkVersion<\/code> attribute. Remove the <code>minSdkVersion<\/code> attribute from the <code>AndroidManifest.xml<\/code> file. After removing it, the element should look like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;uses-sdk android:targetSdkVersion=\"your_target_sdk_version\" \/>\r\n<\/code><\/pre>\n\n\n\n<p>Open the <code>build.gradle<\/code> file for the <code>app<\/code> module. It should be located at <code>YourProjectName\/android\/app\/build.gradle<\/code>.<\/p>\n\n\n\n<p>Inside the <code>defaultConfig<\/code> section of the <code>build.gradle<\/code> file, add the <code>minSdkVersion<\/code> declaration:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>android {\r\n    \/\/ ...\r\n    defaultConfig {\r\n        \/\/ ...\r\n        minSdkVersion your_min_sdk_version\r\n        \/\/ ...\r\n    }\r\n    \/\/ ...\r\n}\r\n<\/code><\/pre>\n\n\n\n<p>Replace <code>your_min_sdk_version<\/code> with the appropriate minimum SDK version that your app supports. Sync your project with Gradle by clicking on the &#8220;Sync Project with Gradle Files&#8221; icon or navigating to <code>File > Sync Project with Gradle Files<\/code> in Android Studio.<\/p>\n\n\n\n<p>By moving the <code>minSdkVersion<\/code> from the <code>AndroidManifest.xml<\/code> file to the <code>defaultConfig<\/code> section in the <code>build.gradle<\/code> file, you ensure that the declaration is placed in the correct location, as required by the Android Gradle Plugin. This should resolve the <code>Failed to parse XML...<\/code> error related to the <code>minSdkVersion<\/code> declaration.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The error message you provided indicates the same issue as before: the minSdkVersion should not be declared directly in the AndroidManifest.xml file. To fix this issue, follow&#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-771","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts\/771","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=771"}],"version-history":[{"count":1,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts\/771\/revisions"}],"predecessor-version":[{"id":772,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts\/771\/revisions\/772"}],"wp:attachment":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/media?parent=771"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/categories?post=771"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/tags?post=771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}