It is returning the following error:
NetworkError: Failed to execute ‘send’ on ‘XMLHttpRequest’: failed to load “url…”
when I’m trying to access an API made in Java, only when the apk is generated on the VolteBuilder website. Generating and testing for Browser works correctly.The application was working correctly, it started to give an error in the last week, when I needed to generate a new version. Is anyone going through this?
Nothing is change, the platform is Android. The only thing that changed was when I went to generate the APK and there was an error in the config.xml, more specifically in the line below where I changed the value to 33.
The url call is very simple, I even made a test application with the lines below. the call works on the cell phone’s Borwser but when it generates apk it doesn’t work.
Function Button1_onclick()
req=Ajax("http://" & Input1.value & "/ComandaTest/index.jsp?wLocal=1")
Label2.value = "http://" & Input1.value & "/ComandaTest/index.jsp?wLocal=1" & Chr(13)
If req.status=200 Then
Label2.value = req.responseText
Else
Label2.value = Label2.value & "state: " & req.readyState & Chr(13)
Label2.value = Label2.value & "ret = " & req.statusText & Chr(13)
Label2.value = Label2.value & "Num Status = " & req.status & Chr(13)
Label2.value = Label2.value & "Erro = " & req.error & Chr(13)
End If
End Function
I also have voltbuilder problem for 2 weeks, although the err is different. This is how I solve the problem. (1)the pwa png have to be 144x144.(2)the apk is save in my thumb drive. Hopes it helps… Best rdgs, tst
I can generate and install the apk on the cell phone, but when I call the url via the apk it gives the error reported at the beginning of the forum, thanks for the answer.
One more detail, as I generated a new apk to make the AJAX call, I was changing the config.xml as I was researching this problem on the internet, below is the config. Has anyone gone through this and have any new ideas?
Actually I tried with 31, 32, 33 and also with the default config.xml which is without these tags. What led me to put it was the error in apk generation in voltbuilder that requested the sdk 32 because in my original project it was 23. But in no way can I consult the URL.
If I understood the second part of the question, when I run it in the Browser, the error does not occur.
But I know that it’s not just him who needs it because I tried to put the config.xml with just her and it didn’t work.
Finally, the Config looked like this:
I would suggest using HTTPS rather than HTTP. This is the proper solution to the problem. Even for testing there are options like https://ngrok.com/ to help with getting a proper certificate and your API on the internet.