error 404 after building an apk with PhoneGap


Amin Mousavi
Hi All,In the app I am building I am using HTTP client in several places and they all are working smoothly in AppBuilder's debugger. But now that I have built the app to an apk file, android constantly throws 404 error when attempting to connect to server. APIs are working fine as at the same time they respond to debugger. What ever it is, has happened during the build and there is something there preventing app's outside connection. Any idea how it can be fixed?Thanks a mill,Amin 

DecSoft

Hello Amin,

An HTTP 404 error code means that the server can't be reached, certainly. Maybe are you using "local URLs" (that points to your local server) when debugging? Then you must prepare the right URLs with to reach the real internet server. We can set the URLs of HTTP Client controls in design but also in runtime, with the "HttpSetUrl" action, for example.

On the other hand, you mention Phonegap. I think this doesn't made any difference, but, consider to use Apache Cordova instead: App Builder is better integrated with Apache Cordova. But, again, in principle, this do not matter. Additionally, check if your device have an internet connection! But an 404 error is clear: the server can't be reached.

One more thing: App Builder nor Apache Cordova nor Phonegap, don't touch the URLs of the HTTP Clients, so, probably the problem is not specifically related with these software. Just be sure that you are trying to use the right URLs, Amin.



Amin Mousavi

Hi David,

Links and internet connection are fine, have checked them already. Tried Apache Cordova and still the same issue. Apparently Android blocks calling the outside links and so the 404 error occurs. Installed a "white list" Cordova plugin and it sorted out the issue and now my phone also can reach the server.

Thanks,

Amin   

DecSoft

Hello Amin,

Yes; you are right. Apparently the Cordova's "Whitelist" plugin is required... and, for that reason, App Builder includes it by default in both the Cordova's configuration file and the generated BAT and SHELL files... so you are not using these files Amin? Anyway, glad to know that you got it.


Todo el mundo puede leer el foro de soporte de DecSoft para aprender del mismo, sin embargo, sólo los clientes de DecSoft pueden abrir nuevos hilos. Compre una o más licencias de productos de DecSoft y obtendrá este y otros beneficios.

Este sitio utiliza "cookies" útiles para almacenar sus preferencias.

Bien. Ocultar esta nota. Obtener más información.