Error:network_request_failed for Web API Get on Android

Hello Thunkable,
I am connecting web api to my app. it works fine in livetest window but it throw me a error NETWORK REQUEST FAILED while test/install app on my android phone.
pls reply asap …

@imponiaamanl6pe,

Welcome to the Community!

Can you share the blocks you used to call the web api?

In particular, the URLs you are using. Of course, you should hide any API keys.

failed

Check!

Hmmm, I am not able to access that resource.

Server/Hosting permissions are NOT my long suit. In fact, they are all but a complete mystery to me. But my experience using the Firebase Emulator and thunkable has been that Thunkable Web can access local host resource, while apps cannot. This makes me wonder if perhaps the machine you are using the web Live Test on has permissons to https://youngmanbeta.com/testandroid, but https://youngmanbeta.com/testandroid is not a public site.

Again, I apologize, I don’t really understand how permissons work. Hopefully some of the other power thunkers can help you.

1 Like

You are right.

https://youngmanbeta.com requires authentication and therefore you need more input in the URL if the site permits.

Bro its a api URL so i think you check it on postman via get method .


api work on browser livetest and also in iphone but it not on Android :confused:

Here are my blocks and results when testing with Reponsive Web app using Chrome on Windows 10

image

1 Like

Because … you make spell error in url its a “testAndroid” not testandroid …
pls send request again

correct url : https://youngmanbeta.com/testAndroid

1 Like

Thanks for the updated URL. I get the WORKING message on my android brower, but Thunkable Live Test on Android fails. I also verified the updated URL works on Web and iOS (images not shown). Unfortunately, I don’t have much more to add to the discussion.

I would recommend you reach out to Thunkable using the Chatbot on the Project Design page AND log an issue in GitHub.

1 Like

Sorry, had one more observation. I tried adding a webviewer to the screen to see if that would be able to access the URL. When I add the webviewer, the web API also starts working.
image

image

Obviously this is not a fix, but it may be helpful to add to your GitHub ticket and act as a work around until Thunkable addresses the issue.

One other possibility to try might be to return a JSON message instead of straight text. Again, Thunkable SHOULD still work, but perhaps that change might work on android. Total W.A.G.

1 Like

Well, to be fair @imponiaamanl6pe, you had testandroid in your original screenshot:


Also, can tell us a bit more about your app. Is it just supposed to display the word working? From your blocks you also seem to have an “LoginScreen”, is there an authentication part to this too?

Thanks

2 Likes

okay i accept it … but brother am also shared a postman Shot.

after trying with other api it works but it does not work particularly with https://youngmanbeta.com/
So i found it just because of my SSL cerificate (youngmanbeta.com ). certificate not allow android to connect .
any idea about how resolve it ???

Unfortunately, internet protocols are a mystery to me.

Okay … btw thankyou

I’m sure you have been “googling” the internet for solutions, but here was a promising article https://developer.android.com/training/articles/security-ssl.

Best of luck!