{"id":1306,"date":"2022-09-29T12:02:13","date_gmt":"2022-09-29T12:02:13","guid":{"rendered":"http:\/\/www.netexl.com\/blog\/?p=1306"},"modified":"2026-04-02T09:19:38","modified_gmt":"2026-04-02T09:19:38","slug":"cordova-app-error-the-connection-to-the-server-was-unsuccessful","status":"publish","type":"post","link":"https:\/\/www.netexl.com\/blog\/cordova-app-error-the-connection-to-the-server-was-unsuccessful\/","title":{"rendered":"Cordova App Error: The connection to the server was unsuccessful"},"content":{"rendered":"\n<p>After migrating to cordova 11 when I created a new app with android-targetSdkVersion set to 32, some of the mobiles were giving this error<\/p>\n\n\n\n<p>The connection to the server was unsuccessful. (https:\/\/localhost\/index.html).<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"579\" height=\"241\" src=\"https:\/\/www.netexl.com\/blog\/wp-content\/uploads\/2022\/09\/image-1.png\" alt=\"\" class=\"wp-image-1307\" srcset=\"https:\/\/www.netexl.com\/blog\/wp-content\/uploads\/2022\/09\/image-1.png 579w, https:\/\/www.netexl.com\/blog\/wp-content\/uploads\/2022\/09\/image-1-300x125.png 300w, https:\/\/www.netexl.com\/blog\/wp-content\/uploads\/2022\/09\/image-1-280x117.png 280w\" sizes=\"auto, (max-width: 579px) 100vw, 579px\" \/><\/figure>\n\n\n\n<p>Following entries in config.xml helped fix this problem.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;allow-navigation href=\"*\" \/>\n&lt;content src=\"index.html\"\/>\n&lt;content original-src=\"index.html\" \/><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>After migrating to cordova 11 when I created a new app with android-targetSdkVersion set to 32, some of the mobiles were giving this error The connection to the server was unsuccessful. (https:\/\/localhost\/index.html). Following entries in config.xml helped fix this problem.<\/p>\n","protected":false},"author":5,"featured_media":1541,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,28,29],"tags":[],"class_list":["post-1306","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android","category-cordova","category-issue"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/posts\/1306","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/comments?post=1306"}],"version-history":[{"count":1,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/posts\/1306\/revisions"}],"predecessor-version":[{"id":1308,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/posts\/1306\/revisions\/1308"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/media\/1541"}],"wp:attachment":[{"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/media?parent=1306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/categories?post=1306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/tags?post=1306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}