[EDIT2] fixed by adding the following in the android manifest
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
...
android:usesCleartextTraffic="true">
Between the error message "Failed to execute http call" is pretty bad.. I had to install and setup a basic conf with Volley to find what's happening..
Hi, I try to get working a very basic app.
My schema are downloaded using apollo cli, my graphQL API is working perfectly (tested the query on playground) and run locally on http://localhost:4000/ (this is the endpoint).
[EDIT] If I set BASE_URL to http://10.0.2.2:4000 I got the same error for the app. But I can access to the graphql playground through google chrome from the emulator.
schema.json and the .graphql file are located under the /graphql directory.
The project is building without any error, apollo-android generate all stuff finely.
Exception:
com.apollographql.apollo.internal.interceptor.ApolloServerInterceptor$1$1.onFailure(ApolloServerInterceptor.java:89)
okhttp3.RealCall$AsyncCall.execute(RealCall.java:148)
okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
java.lang.Thread.run(Thread.java:764)
Failed to execute http call
I missed something ?
None of those things worked for me.
Why is apollo making a network failure a fatal error?
Where is the solution?
Calls to the insecure http protocol will not work with Android as part of their security policy. You need https.
Set up a secure tunnel to localhost (I know, counter-intuitive, but hey) by executing the following in a terminal
Most helpful comment
None of those things worked for me.
Why is apollo making a network failure a fatal error?