Quantcast
Channel: Active questions tagged https - Stack Overflow
Viewing all articles
Browse latest Browse all 1818

Expo Go HTTPS-Request doesn't work on android but works on every other OS. (HTTP-Requests are working)

$
0
0

When I change my environment variable from https://XXXX.com to http://37.XX.XXX.XXX:XXXX, my Expo Go app on Android works, but the HTTPS request doesn't.

Versions:

  • EXPO-Version: 0.18.26
  • Expo: 51.0.24
  • react-native: ^0.74.3
try {  const response = await fetch(    process.env.EXPO_PUBLIC_API_URL +"/login/create",    {      method: "GET",      headers: {"Content-Type": "application/json","User-Agent": "Mozilla/5.0",      },    }  );  console.log(response);  if (!response.ok) {    throw new Error(`Fetch request failed with status ${response.status}`);  }  const data = await response.json();  setError("received");  console.log("Data received:", data);  // Working with the response} catch (error) {  console.error("Fehler beim Abrufen der Daten:", error);}

I checked the app.json multiple times:

"android": {"adaptiveIcon": {"foregroundImage": "./assets/images/icon.png","backgroundColor": "#ffffff"  },"package": "XXX","versionCode": 13,"permissions": ["INTERNET","ACCESS_NETWORK_STATE"  ]},

This bug occurs only on Android, including in the build version of the app.


Viewing all articles
Browse latest Browse all 1818

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>