Open DanMakingWithAI opened 1 month ago
A bit more Perplexity searching suggests the reasonable fix might be to use the expo-network
plugin and update the plugin section of the app.config.ts
file to include the relevant section of this:
import { ExpoConfig } from 'expo/config';
const config: ExpoConfig = {
// ... other configurations
android: {
// ... other Android-specific configurations
},
plugins: [
[
'expo-network',
{
'android': {
'networkSecurityConfig': {
'cleartextTrafficPermitted': false,
'domains': [
{
'domain': '10.0.0.0/8',
'cleartextTrafficPermitted': true
},
{
'domain': '172.16.0.0/12',
'cleartextTrafficPermitted': true
},
{
'domain': '192.168.0.0/16',
'cleartextTrafficPermitted': true
}
]
}
}
}
]
],
// ... rest of your configuration
};
export default config;
Means little to me as I don't know Expo/React Native, but I get the IP address reasoning so hopefully this isn't too far off hte mark 😄
This is so helpful, thank you so much @DanMakingWithAI!
Crosspost from Discord
A bit of digging suggests that on newer Android phones, the 01 mobile app will refuse to connect to a local livekit server (such as the one exposed by the 01 python code) that is served over http rather than https. I had suspected this to be the cause of my app not connecting, and a logcat over adb confirms it - the app produces this in the log trace (after the token check passes)
Of course, using ngrok you get an https endpoint, so folks doing the
--expose
flag when starting the 01 server should not experience this.I only say 'newer Android phones' because I searched the error line in Perplexity : https://www.perplexity.ai/search/reactnaivejs-livekit-error-cle-WPS1IVDRQ56eacKjW0o8lg
That (re)search thread proposes fixes, if desired - enabling cleartext communication only for local networks and with a clear warning to users could be a reasonable idea. Or denying it and alerting on 'http' rather than 'https'. Or catching and relaying the warning etc. etc.
Alternatively, updating the documentation to say this won't work is fine, too. I have no particular opinion either way. 😊