Following expo quick start example,
I added 100mslive/react-native-hms and other related packages to project. Configured and acquired permissions.
Now using useEffect hook to check up if permissions are granted and calling HMSSDK.build(). If this line is commented, app is running both on iPhone 12 and iOS 16 simulator.
If I uncomment that line, app builds and launches, but crashes right after splash screen without any error in expo console. MacOs is detecting crash and generating following log,
Expo SDK: 51
New architecture enabled.
100ms React Native Version
1.10.9
React Native Version
0.74.5
Steps to reproduce
Scaffold a new expo app with expo-router and expo SDK 51
Create a button to go to /hms on home page.
Include following in the _layout.tsx inside hms folder
import {
HMSAudioTrackSettings,
HMSLogAlarmManager,
HMSLogLevel,
HMSLogSettings,
HMSSDK,
HMSTrackSettings,
HMSTrackSettingsInitState,
HMSVideoTrackSettings,
} from "@100mslive/react-native-hms";
import {
CameraType,
useCameraPermissions,
useMicrophonePermissions,
} from "expo-camera";
import { Stack } from "expo-router";
import { useEffect, useState } from "react";
import { Text } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import { Button } from "~/components/ui/button";
export default function CallLayout() {
const [facing, setFacing] = useState<CameraType>("back");
const [mic, requestMic] = useMicrophonePermissions();
const [cam, requestCam] = useCameraPermissions();
useEffect(() => {
const getTrackSettings = () => {
const audioSettings = new HMSAudioTrackSettings({
initialState: HMSTrackSettingsInitState.UNMUTED,
});
const videoSettings = new HMSVideoTrackSettings({
initialState: HMSTrackSettingsInitState.UNMUTED,
});
return new HMSTrackSettings({
video: videoSettings,
audio: audioSettings,
});
};
if (cam?.granted && mic?.granted) {
HMSSDK.build({
logSettings: new HMSLogSettings({
level: HMSLogLevel.VERBOSE,
isLogStorageEnabled: true,
maxDirSizeInBytes: HMSLogAlarmManager.DEFAULT_DIR_SIZE,
}),
trackSettings: getTrackSettings(),
}).catch((e: unknown) => {
console.error(e);
});
}
}, [cam?.granted, mic?.granted]);
if (!mic || !cam) {
return (
<SafeAreaView>
<Text>Loading permissions</Text>
</SafeAreaView>
);
}
if (!mic.granted) {
return (
<SafeAreaView>
<Text>Microphone permissions required</Text>
{mic.canAskAgain ? (
<Button onPress={requestMic}>
<Text>Allow using microphone </Text>
</Button>
) : (
<Text>Go to app setting to allow</Text>
)}
</SafeAreaView>
);
}
if (!cam.granted) {
return (
<SafeAreaView>
<Text>Camera permissions required</Text>
{mic.canAskAgain ? (
<Button onPress={requestCam}>
<Text>Allow using Camera </Text>
</Button>
) : (
<Text>Go to app setting to allow</Text>
)}
</SafeAreaView>
);
}
return (
<Stack>
<Stack.Screen name="index" options={{ headerShown: false }} />
</Stack>
);
}
Run app on ios device simulator using npx expo prebuild --clean && npx expo run:ios
App works if block starting from HMSSDK.build( is commented and run again.
Expected results
App runs with 100ms integration and ability to join video calls.
Description
Following expo quick start example, I added 100mslive/react-native-hms and other related packages to project. Configured and acquired permissions. Now using useEffect hook to check up if permissions are granted and calling HMSSDK.build(). If this line is commented, app is running both on iPhone 12 and iOS 16 simulator.
If I uncomment that line, app builds and launches, but crashes right after splash screen without any error in expo console. MacOs is detecting crash and generating following log,
Expo SDK: 51 New architecture enabled.
100ms React Native Version
1.10.9
React Native Version
0.74.5
Steps to reproduce
Scaffold a new expo app with expo-router and expo SDK 51
Create a button to go to
/hms
on home page.Include following in the
_layout.tsx
inside hms folderRun app on ios device simulator using
npx expo prebuild --clean && npx expo run:ios
App works if block starting from
HMSSDK.build(
is commented and run again.Expected results
App runs with 100ms integration and ability to join video calls.
Entire logs with CLI output Logs
Logs
Build log attached in next commnent ```console ------------------------------------- Translated Report (Full Report Below) ------------------------------------- Incident Identifier: 39DCC671-22E5-4ED3-BEF9-D79F531D0F46 CrashReporter Key: 87633338-EE75-9C54-B9A3-099783D6692B Hardware Model: MacBookPro18,3 Process: PatientDev [42778] Path: /Users/USER/Library/Developer/CoreSimulator/Devices/F2DAB3E6-B36F-4938-A648-C9D838228E39/data/Containers/Bundle/Application/DE6CAFFC-853D-4D39-A28E-095E50C3AC48/PatientDev.app/PatientDev Identifier: com.hellowellness.patient.dev Version: 1.0.0 (1) Code Type: ARM-64 (Native) Role: Foreground Parent Process: launchd_sim [36557] Coalition: com.apple.CoreSimulator.SimDevice.F2DAB3E6-B36F-4938-A648-C9D838228E39 [275241] Responsible Process: SimulatorTrampoline [12303] Date/Time: 2024-08-11 10:30:56.7986 +0530 Launch Time: 2024-08-11 10:30:45.9069 +0530 OS Version: macOS 14.5 (23F79) Release Type: User Report Version: 104 Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000 Exception Codes: 0x0000000000000001, 0x0000000000000000 VM Region Info: 0 is not in any region. Bytes before following region: 4342398976 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL UNUSED SPACE AT START ---> __TEXT 102d3c000-1055d8000 [ 40.6M] r-x/r-x SM=COW /Users/USER/Library/Developer/CoreSimulator/Devices/F2DAB3E6-B36F-4938-A648-C9D838228E39/data/Containers/Bundle/Application/DE6CAFFC-853D-4D39-A28E-095E50C3AC48/PatientDev.app/PatientDev Termination Reason: SIGNAL 11 Segmentation fault: 11 Terminating Process: exc handler [42778] Triggered by Thread: 12 Kernel Triage: VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter Thread 0:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x10a02d570 mach_msg2_trap + 8 1 libsystem_kernel.dylib 0x10a03eb80 mach_msg2_internal + 76 2 libsystem_kernel.dylib 0x10a035798 mach_msg_overwrite + 532 3 libsystem_kernel.dylib 0x10a02d8e8 mach_msg + 20 4 CoreFoundation 0x18040e6c4 __CFRunLoopServiceMachPort + 156 5 CoreFoundation 0x180408da4 __CFRunLoopRun + 1148 6 CoreFoundation 0x180408514 CFRunLoopRunSpecific + 572 7 GraphicsServices 0x18ef06ae4 GSEventRunModal + 160 8 UIKitCore 0x1853e8040 -[UIApplication _run] + 868 9 UIKitCore 0x1853ebcc8 UIApplicationMain + 124 10 PatientDev 0x102d41060 main + 96 (main.m:7) 11 dyld_sim 0x109fa1544 start_sim + 20 12 dyld 0x10a1420e0 start + 2360 Thread 1: 0 libsystem_pthread.dylib 0x10ae365cc start_wqthread + 0 Thread 2: 0 libsystem_pthread.dylib 0x10ae365cc start_wqthread + 0 Thread 3:: com.apple.uikit.eventfetch-thread 0 libsystem_kernel.dylib 0x10a02d570 mach_msg2_trap + 8 1 libsystem_kernel.dylib 0x10a03eb80 mach_msg2_internal + 76 2 libsystem_kernel.dylib 0x10a035798 mach_msg_overwrite + 532 3 libsystem_kernel.dylib 0x10a02d8e8 mach_msg + 20 4 CoreFoundation 0x18040e6c4 __CFRunLoopServiceMachPort + 156 5 CoreFoundation 0x180408da4 __CFRunLoopRun + 1148 6 CoreFoundation 0x180408514 CFRunLoopRunSpecific + 572 7 Foundation 0x180dea38c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 208 8 Foundation 0x180dea5b0 -[NSRunLoop(NSRunLoop) runUntilDate:] + 60 9 UIKitCore 0x18548df20 -[UIEventFetcher threadMain] + 404 10 Foundation 0x180e10be4 __NSThread__start__ + 720 11 libsystem_pthread.dylib 0x10ae3b414 _pthread_start + 104 12 libsystem_pthread.dylib 0x10ae365e0 thread_start + 8 Thread 4: 0 libsystem_pthread.dylib 0x10ae365cc start_wqthread + 0 Thread 5: 0 libsystem_pthread.dylib 0x10ae365cc start_wqthread + 0 Thread 6: 0 libsystem_pthread.dylib 0x10ae365cc start_wqthread + 0 Thread 7: 0 libsystem_pthread.dylib 0x10ae365cc start_wqthread + 0 Thread 8:: com.google.firebase.crashlytics.MachExceptionServer 0 libsystem_kernel.dylib 0x10a030d3c write + 8 1 PatientDev 0x103270e10 FIRCLSSDKFileLog + 424 (FIRCLSInternalLogging.c:62) 2 PatientDev 0x103273b48 FIRCLSMachExceptionReply + 332 (FIRCLSMachException.c:265) 3 PatientDev 0x1032735ec FIRCLSMachExceptionServer + 100 (FIRCLSMachException.c:176) 4 libsystem_pthread.dylib 0x10ae3b414 _pthread_start + 104 5 libsystem_pthread.dylib 0x10ae365e0 thread_start + 8 Thread 9:: com.apple.CFNetwork.CustomProtocols 0 libsystem_kernel.dylib 0x10a02d570 mach_msg2_trap + 8 1 libsystem_kernel.dylib 0x10a03eb80 mach_msg2_internal + 76 2 libsystem_kernel.dylib 0x10a035798 mach_msg_overwrite + 532 3 libsystem_kernel.dylib 0x10a02d8e8 mach_msg + 20 4 CoreFoundation 0x18040e6c4 __CFRunLoopServiceMachPort + 156 5 CoreFoundation 0x180408da4 __CFRunLoopRun + 1148 6 CoreFoundation 0x180408514 CFRunLoopRunSpecific + 572 7 CFNetwork 0x184540b58 0x184328000 + 2198360 8 Foundation 0x180e10be4 __NSThread__start__ + 720 9 libsystem_pthread.dylib 0x10ae3b414 _pthread_start + 104 10 libsystem_pthread.dylib 0x10ae365e0 thread_start + 8 Thread 10:: com.facebook.SocketRocket.NetworkThread 0 libsystem_kernel.dylib 0x10a02d570 mach_msg2_trap + 8 1 libsystem_kernel.dylib 0x10a03eb80 mach_msg2_internal + 76 2 libsystem_kernel.dylib 0x10a035798 mach_msg_overwrite + 532 3 libsystem_kernel.dylib 0x10a02d8e8 mach_msg + 20 4 CoreFoundation 0x18040e6c4 __CFRunLoopServiceMachPort + 156 5 CoreFoundation 0x180408da4 __CFRunLoopRun + 1148 6 CoreFoundation 0x180408514 CFRunLoopRunSpecific + 572 7 Foundation 0x180dea38c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 208 8 PatientDev 0x1040762b8 -[SRRunLoopThread main] + 260 (SRRunLoopThread.m:71) 9 Foundation 0x180e10be4 __NSThread__start__ + 720 10 libsystem_pthread.dylib 0x10ae3b414 _pthread_start + 104 11 libsystem_pthread.dylib 0x10ae365e0 thread_start + 8 Thread 11:: com.apple.NSURLConnectionLoader 0 libsystem_kernel.dylib 0x10a02d570 mach_msg2_trap + 8 1 libsystem_kernel.dylib 0x10a03eb80 mach_msg2_internal + 76 2 libsystem_kernel.dylib 0x10a035798 mach_msg_overwrite + 532 3 libsystem_kernel.dylib 0x10a02d8e8 mach_msg + 20 4 CoreFoundation 0x18040e6c4 __CFRunLoopServiceMachPort + 156 5 CoreFoundation 0x180408da4 __CFRunLoopRun + 1148 6 CoreFoundation 0x180408514 CFRunLoopRunSpecific + 572 7 CFNetwork 0x184540b58 0x184328000 + 2198360 8 Foundation 0x180e10be4 __NSThread__start__ + 720 9 libsystem_pthread.dylib 0x10ae3b414 _pthread_start + 104 10 libsystem_pthread.dylib 0x10ae365e0 thread_start + 8 Thread 12 Crashed:: com.facebook.react.runtime.JavaScript 0 libsystem_platform.dylib 0x109ec4c24 _platform_strlen + 4 1 PatientDev 0x102d44594 std::__1::__constexpr_strlen[abi:ue170006](char const*) + 24 (constexpr_c_functions.h:49) 2 PatientDev 0x102d444a4 std::__1::char_traits