Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo App Crashed on iOS working Fine on Android #33

Closed
sacmii opened this issue Nov 24, 2020 · 10 comments
Closed

Demo App Crashed on iOS working Fine on Android #33

sacmii opened this issue Nov 24, 2020 · 10 comments

Comments

@sacmii
Copy link

sacmii commented Nov 24, 2020

image
image
image
image
image

Environment
System:
OS: macOS 10.15.7
CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
Memory: 157.21 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 14.15.0 - ~/.nvm/versions/node/v14.15.0/bin/node
Yarn: 1.22.10 - ~/.nvm/versions/node/v14.15.0/bin/yarn
npm: 6.14.8 - ~/.nvm/versions/node/v14.15.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.0 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.2, DriverKit 20.0, macOS 11.0, tvOS 14.2, watchOS 7.1
Android SDK:
API Levels: 28, 29, 30
Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.2
System Images: android-30 | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.6858069
Xcode: 12.2/12B45b - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_272 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: ^16.14.0 => 16.14.0
react-native: ^0.63.3 => 0.63.3
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

@tianyux-amz
Copy link

Hi @sacmii, I was not able to reproduce this issue.

  • Did you make any change to the demo app?
  • What's the version of AmazonChimeSDK.framework and AmazonChimeSDKMedia.framework that you are using?

@sacmii
Copy link
Author

sacmii commented Nov 25, 2020

Hi @sacmii, I was not able to reproduce this issue.

  • Did you make any change to the demo app?
  • What's the version of AmazonChimeSDK.framework and AmazonChimeSDKMedia.framework that you are using?

AmazonChimeSDK-0.8.2.tar.gz and
AmazonChimeSDKMedia-0.6.1.tar.gz

@marcspicer
Copy link

Looks like you are not providing ExternalMeetingId in your chime.createMeeting call and it's returning you null ExternalMeetingId.

@tianyux-amz
Copy link

Thanks @marcspicer. While I'm also curious about what happened to ExternalMeetingId, it shouldn't be the root cause because it's a string "<null>", not a nil string. I also tested with ExternalMeetingId set to "<null>" and nil, but there was no crash.

The error indicates that there is something that should be a NSString but it's actually a NSNull. @sacmii, could you provide more details on what have you changed in the demo app, especially in NativeMobileSDKBridge.startMeeting()?

@sacmii
Copy link
Author

sacmii commented Nov 26, 2020

startMeeting
there are no changes i made.
Adding startMeeting function over here @tianyux-amz

# pragma mark: Native Function
RCT_EXPORT_METHOD(startMeeting:(NSDictionary *)meetingInfoDict attendeeInfo:(NSDictionary *)attendeeInfoDict)
{
  if (meetingSession != nil)
  {
    [meetingSession.audioVideo stop];
    meetingSession = nil;
  }

  logger = [[ConsoleLogger alloc] initWithName:@"NativeMobileSDKBridge" level:LogLevelDEFAULT];
  [logger infoWithMsg: [[NSString alloc] initWithFormat:@"Running Amazon Chime SDK (%@)", Versioning.sdkVersion]];
  // Parse meeting join data from payload
  NSDictionary *mediaPlacementDict = [meetingInfoDict objectForKey:kMediaPlacement];

  // Parse meeting info
  NSString *meetingId = [meetingInfoDict objectForKey:kMeetingId];
  NSString *externalMeetingId = [meetingInfoDict objectForKey:kExternalMeetingId];
  NSString *meetingRegion = [meetingInfoDict objectForKey:kMediaRegion];

  // Parse meeting join info
  NSString *audioFallbackUrl = [mediaPlacementDict objectForKey:kAudioFallbackUrl];
  NSString *audioHostUrl = [mediaPlacementDict objectForKey:kAudioHostUrl];
  NSString *turnControlUrl = [mediaPlacementDict objectForKey:kTurnControlUrl];
  NSString *signalingUrl = [mediaPlacementDict objectForKey:kSignalingUrl];

  // Parse attendee info
  NSString *attendeeId = [attendeeInfoDict objectForKey:kAttendeeId];
  NSString *externalUserId = [attendeeInfoDict objectForKey:kExternalUserId];
  NSString *joinToken = [attendeeInfoDict objectForKey:kJoinToken];

  // Initialize meeting session through AmazonChimeSDK
  MediaPlacement *mediaPlacement = [[MediaPlacement alloc] initWithAudioFallbackUrl:audioFallbackUrl
                                                                       audioHostUrl:audioHostUrl
                                                                       signalingUrl:signalingUrl
                                                                     turnControlUrl:turnControlUrl];

  Meeting *meeting = [[Meeting alloc] initWithExternalMeetingId:externalMeetingId
                                                 mediaPlacement:mediaPlacement
                                                    mediaRegion:meetingRegion
                                                      meetingId:meetingId];
  
  CreateMeetingResponse *createMeetingResponse = [[CreateMeetingResponse alloc] initWithMeeting:meeting];

  Attendee *attendee = [[Attendee alloc] initWithAttendeeId:attendeeId
                                             externalUserId:externalUserId joinToken:joinToken];

  CreateAttendeeResponse *createAttendeeResponse = [[CreateAttendeeResponse alloc] initWithAttendee:attendee];
  MeetingSessionConfiguration *meetingSessionConfiguration = [[MeetingSessionConfiguration alloc] initWithCreateMeetingResponse:createMeetingResponse
                                                                                                         createAttendeeResponse:createAttendeeResponse];

  meetingSession = [[DefaultMeetingSession alloc] initWithConfiguration:meetingSessionConfiguration
                                                                 logger:logger];
  [self startAudioClient];
}

@tianyux-amz
Copy link

Hi @sacmii ,

The startMeeting() implementation looks good to me. Could you try to log out all the NSStrings in startMeeting() and see which one is nil? Also, could you try to clone the repo again and strictly follow How to Run the React Native Demo Application guide and see if the issue persists?

@sacmii
Copy link
Author

sacmii commented Dec 3, 2020

@tianyux-amz

issue still persists.. attaching log

RNDemo[...] 3affde2b-3eeb-4314-bb56-d4acefdbcef9 meetingId
RNDemo[...] <null> externalMeetingId
RNDemo[...] us-east-1 meetingRegion
RNDemo[...] wss://haxrp.m3.ue1.app.chime.aws:443/calls/3affde2b-3eeb-4314-bb56-d4acefdbcef9 audioFallbackUrl
RNDemo[...] b002e21a0fec0eed9ed387fcfce27b84.k.m3.ue1.app.chime.aws:3478 audioHostUrl
RNDemo[...] https://ccp.cp.ue1.app.chime.aws/v2/turn_sessions turnControlUrl
RNDemo[...] wss://signal.m3.ue1.app.chime.aws/control/3affde2b-3eeb-4314-bb56-d4acefdbcef9 signalingUrl
RNDemo[...] ab8bd69d-1f22-17bb-15ed-1f0e31f46791 attendeeId
RNDemo[...] 0f148bee-a1d3-4727-a73e-e9a1754fc850 externalUserId
RNDemo[...] YWI4YmQ2OWQtMWYyMi0xN2JiLTE1ZWQtMWYwZTMxZjQ2NzkxOmUxMGVlMjBlLTEzYjctNGJlYi05NDZlLWJmOTI4N2E4NTQ0Ng joinToken
RNDemo[...] -[NSNull _fastCStringContents:]: unrecognized selector sent to instance 0x1fb909ee0
[fatal][tid:com.facebook.react.NativeMobileSDKBridgeQueue] Exception '-[NSNull _fastCStringContents:]: unrecognized selector sent to instance 0x1fb909ee0' was thrown while invoking startMeeting on target NativeMobileSDKBridge with params (
        {
        ExternalMeetingId = "<null>";
        MediaPlacement =         {
            AudioFallbackUrl = "wss://haxrp.m1.ue1.app.chime.aws:443/calls/3a8ac2ab-c050-42fc-8033-35d0879d1b51";
            AudioHostUrl = "c7b8e2fa0bd7b098d53452c12493845a.k.m1.ue1.app.chime.aws:3478";
            ScreenDataUrl = "wss://bitpw.m1.ue1.app.chime.aws:443/v2/screen/3a8ac2ab-c050-42fc-8033-35d0879d1b51";
            ScreenSharingUrl = "wss://bitpw.m1.ue1.app.chime.aws:443/v2/screen/3a8ac2ab-c050-42fc-8033-35d0879d1b51";
            ScreenViewingUrl = "wss://bitpw.m1.ue1.app.chime.aws:443/ws/connect?passcode=null&viewer_uuid=null&X-BitHub-Call-Id=3a8ac2ab-c050-42fc-8033-35d0879d1b51";
            SignalingUrl = "wss://signal.m1.ue1.app.chime.aws/control/3a8ac2ab-c050-42fc-8033-35d0879d1b51";
            TurnControlUrl = "https://ccp.cp.ue1.app.chime.aws/v2/turn_sessions";
        };
        MediaRegion = "us-east-1";
        MeetingId = "3a8ac2ab-c050-42fc-8033-35d0879d1b51";
    },
        {
        AttendeeId = "a86b5efc-5aef-f121-3c74-5377c8b036db";
        ExternalUserId = "3cc73837-8a0b-4382-a76c-bd0c5f7da4f7";
        JoinToken = YTg2YjVlZmMtNWFlZi1mMTIxLTNjNzQtNTM3N2M4YjAzNmRiOjllZWVlNjY4LTI3ODItNGI2ZS1iNDZhLTFiMGQ3NjdjYzFhNw;
    }
)
callstack: (
	0   CoreFoundation                      0x00000001ada3d9e8 96F8386D-D88A-3C89-A323-A17975C3317F + 1157608
	1   libobjc.A.dylib                     0x00000001c13eeb54 objc_exception_throw + 56
	2   CoreFoundation                      0x00000001ad94dbac 96F8386D-D88A-3C89-A323-A17975C3317F + 175020
	3   CoreFoundation                      0x00000001ada40018 96F8386D-D88A-3C89-A323-A17975C3317F + 1167384
	4   CoreFoundation                      0x00000001ada41f8c _CF_forwarding_prep_0 + 92
	5   libswiftCore.dylib                  0x00000001b15c0498 $ss18_bridgeCocoaStringys01_C4GutsVyXlF + 100
	6   libswiftCore.dylib                  0x00000001b15c0788 $sSS12_cocoaStringSSyXl_tcfC + 24
	7   libswiftFoundation.dylib            0x00000001b12bbefc $sSS10FoundationE36_unconditionallyBridgeFromObjectiveCySSSo8NSStringCSgFZ + 32
	8   AmazonChimeSDK                      0x0000000105fdc6a4 block_destroy_helper + 1516
	9   RNDemo                              0x000000010203fdd0 -[NativeMobileSDKBridge startMeeting:attendeeInfo:] + 1296
	10  CoreFoundation                      0x00000001ada42130 96F8386D-D88A-3C89-A323-A17975C3317F + 1175856
	11  CoreFoundation                      0x00000001ad9251c0 96F8386D-D88A-3C89-A323-A17975C3317F + 8640
	12  CoreFoundation                      0x00000001ad925720 96F8386D-D88A-3C89-A323-A17975C3317F + 10016
	13  RNDemo                              0x00000001025c5464 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 1880
	14  RNDemo                              0x00000001025c8b2c _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 648
	15  RNDemo                              0x00000001025c86e0 _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 128
	16  RNDemo                              0x00000001025c8654 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 28
	17  libdispatch.dylib                   0x0000000106057ce4 _dispatch_call_block_and_release + 24
	18  libdispatch.dylib                   0x0000000106059528 _dispatch_client_callout + 16
	19  libdispatch.dylib                   0x00000001060605ac _dispatch_lane_serial_drain + 748
	20  libdispatch.dylib                   0x0000000106061234 _dispatch_lane_invoke + 452
	21  libdispatch.dylib                   0x000000010606ca5c _dispatch_workloop_worker_thread + 1456
	22  libsystem_pthread.dylib             0x00000001f409e5a4 _pthread_wqthread + 272
	23  libsystem_pthread.dylib             0x00000001f40a1874 start_wqthread + 8
)

@tianyux-amz
Copy link

Hi @sacmii,

I checked again and actually @marcspicer was right. In your log ExternalMeetingId = "<null>"; actually means the ExternalMeetingId is NSNull, because "<null>" is the result of [[NSNull null] description].

Could you check your React Native code and make sure when you call NativeFunction.startMeeting(meetingInfo, attendeeInfo) the meetingInfo.ExternalMeetingId is not null? Ref to the demo app: https://github.com/aws-samples/amazon-chime-react-native-demo/blob/master/src/App.js#L67

@sacmii sacmii closed this as completed Dec 10, 2020
@sacmii
Copy link
Author

sacmii commented Dec 10, 2020

Issue resolved when a new serverless demo is created.

@timorss
Copy link

timorss commented May 20, 2021

Well, I solved it by adding this
meeting.Meeting.ExternalMeetingId= ""

before this
NativeFunction.startMeeting(meeting.Meeting, attendee.Attendee);

So together
meeting.Meeting.ExternalMeetingId= ""
NativeFunction.startMeeting(meeting.Meeting, attendee.Attendee);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants