webrtc iOS native : +[UIDevice deviceType]: unrecognized selector sent to class 0x3aa4b420

792 views
Skip to first unread message

Chen Cong

unread,
Sep 5, 2016, 11:44:13 PM9/5/16
to discuss-webrtc
Hi,

I compile the ios static library and use the library to create a app ,  but when  I ran the app in 5c ,  it showed the error :

2016-09-06 11:36:10.148 WebRTC1[1194:748952] +[UIDevice deviceType]: unrecognized selector sent to class 0x3aa4b420

2016-09-06 11:36:10.149 WebRTC1[1194:748952] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[UIDevice deviceType]: unrecognized selector sent to class 0x3aa4b420'

*** First throw call stack:

(0x23ae1b0b 0x2329edff 0x23ae7371 0x23ae50ab 0x23a0f298 0x101331 0x1013f9 0x2329fabb 0x232a599d 0x232a58a3 0x232abd1b 0xf6851 0xf1c2d 0x342d95 0x265625 0x2657ff 0x257489 0x2555f9 0x1b6b47 0x23e64d 0x22db07 0x23e40b 0x23e2e3 0x23814c7f 0x23814bf3 0x23812a08)

libc++abi.dylib: terminating with uncaught exception of type NSException


I can not figure out why it happens.Can anyone help me?


Thanks

-Cong

Henrik Andreasson

unread,
Sep 6, 2016, 8:07:39 AM9/6/16
to discuss-webrtc
What iOS version is used? If not latest (9.3), please update and try again.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/ab215874-b9fc-471c-91d3-a52f4731c9ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nuno Jun

unread,
Sep 29, 2016, 5:00:25 AM9/29/16
to discuss-webrtc
I am having same issue on iOS 10. This issue didn't exist on iOS 9 or earlier. Tested with iPhone 5 and iPad Air 2 using the latest version of webrtc. Please refer to below more information.


(webrtcvoiceengine.cc:522): WebRtcVoiceEngine::WebRtcVoiceEngine

(webrtcvoiceengine.cc:529): Supported send codecs in order of preference:

(webrtcvoiceengine.cc:284): Adding supported codec: opus/48000/2 (111)

(webrtcvoiceengine.cc:284): Adding supported codec: ISAC/16000/1 (103)

(webrtcvoiceengine.cc:284): Adding supported codec: G722/8000/1 (9)

(webrtcvoiceengine.cc:284): Adding supported codec: ILBC/8000/1 (102)

(webrtcvoiceengine.cc:284): Adding supported codec: PCMU/8000/1 (0)

(webrtcvoiceengine.cc:284): Adding supported codec: PCMA/8000/1 (8)

(webrtcvoiceengine.cc:284): Adding supported codec: CN/32000/1 (106)

(webrtcvoiceengine.cc:284): Adding supported codec: CN/16000/1 (105)

(webrtcvoiceengine.cc:284): Adding supported codec: CN/8000/1 (13)

(webrtcvoiceengine.cc:284): Adding supported codec: telephone-event/8000/1 (126)

(webrtcvoiceengine.cc:532): opus/48000/2 (111)

(webrtcvoiceengine.cc:532): ISAC/16000/1 (103)

(webrtcvoiceengine.cc:532): G722/8000/1 (9)

(webrtcvoiceengine.cc:532): ILBC/8000/1 (102)

(webrtcvoiceengine.cc:532): PCMU/8000/1 (0)

(webrtcvoiceengine.cc:532): PCMA/8000/1 (8)

(webrtcvoiceengine.cc:532): CN/32000/1 (106)

(webrtcvoiceengine.cc:532): CN/16000/1 (105)

(webrtcvoiceengine.cc:532): CN/8000/1 (13)

(webrtcvoiceengine.cc:532): telephone-event/8000/1 (126)

(webrtcvoiceengine.cc:535): Supported recv codecs in order of preference:

(webrtcvoiceengine.cc:538): opus/48000/2 (111)

(webrtcvoiceengine.cc:538): isac/16000/1 (103)

(webrtcvoiceengine.cc:538): G722/8000/1 (9)

(webrtcvoiceengine.cc:538): iLBC/8000/1 (102)

(webrtcvoiceengine.cc:538): PCMU/8000/1 (0)

(webrtcvoiceengine.cc:538): PCMA/8000/1 (8)

(webrtcvoiceengine.cc:538): cn/16000/1 (105)

(webrtcvoiceengine.cc:538): cn/8000/1 (13)

(webrtcvoiceengine.cc:538): telephone-event/8000/1 (126)

(webrtcvoiceengine.cc:546): VoiceEngine 4.1.0

(audio_device_impl.cc:86): Create

(audio_device_buffer.cc:68): AudioDeviceBuffer::ctor

(audio_device_impl.cc:133): AudioDeviceModuleImpl

(audio_device_impl.cc:141): CheckPlatform

(audio_device_impl.cc:158): current platform is IOS

(audio_device_impl.cc:182): CreatePlatformSpecificObjects

(audio_device_impl.cc:1881): PlatformAudioLayer

(audio_device_ios.mm:103): AudioDeviceIOS::ctor<NSThread: 0x1764f890>{number = 9, name = (null)}

(audio_device_impl.cc:324): iPhone Audio APIs will be utilized

(audio_device_impl.cc:371): AttachAudioBuffer

(audio_device_ios.mm:117): AudioDeviceIOS::AttachAudioBuffer

(audio_device_impl.cc:1482): RegisterEventObserver

(audio_device_impl.cc:1495): RegisterAudioCallback

(audio_device_buffer.cc:110): RegisterAudioCallback

(audio_device_impl.cc:499): Init

(audio_device_ios.mm:124): AudioDeviceIOS::Init

2016-09-29 17:43:36.292489 biz_typhone_iphone[518:439689] +[UIDevice deviceType]: unrecognized selector sent to class 0x3896dac0

2016-09-29 17:43:36.293170 biz_typhone_iphone[518:439689] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[UIDevice deviceType]: unrecognized selector sent to class 0x3896dac0'

*** First throw call stack:

(0x1beb2e07 0x1b113077 0x1beb8477 0x1beb6589 0x1bddbf08 0x57945b 0x57950d 0x1b113bbd 0x1b113e03 0x1b11a74f 0x1b11a661 0x1b12096f 0x56e70b 0x569e09 0x6626eb 0x52cfe3 0x52d187 0x51d267 0x51ccbd 0x4ad883 0x4f0763 0x4e0809 0x4f04e9 0x4f03b9 0x1b710a17 0x1b71093d 0x1b70e498)

Henrik Andreasson

unread,
Sep 29, 2016, 5:34:33 AM9/29/16
to discuss-webrtc
Please file a bug on the WebRTC issue tracker. The AppRTCMobile demo based on ToT WebRTC works well on iOS10 for iPhone 6 and 6s.
If the issue only happens in your application; provide as many details as possible or try to reproduce using AppRTCMobile on your phone.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.

Nuno Jun

unread,
Sep 29, 2016, 5:41:56 AM9/29/16
to discuss-webrtc
Thanks for your quick response.

I guess maybe this issue is not related to iOS 10. I will take a look at this issue further and get back to you.

Many Thanks,

Nuno Jun

unread,
Sep 30, 2016, 3:08:44 AM9/30/16
to discuss-webrtc
I've tried solve this issue and found out belows:

1> This runtime issue occurs when CreatePeerConnectionFactory() invoked and the exact location is as following:

src/webrtc/modules/audio_device/ios/audio_device_ios.mm


AudioDeviceGeneric::InitStatus AudioDeviceIOS::Init() {

  LOGI() << "Init";

  RTC_DCHECK(thread_checker_.CalledOnValidThread());

  if (initialized_) {

    return InitStatus::OK;

  }

#if !defined(NDEBUG)

  LogDeviceInfo();

#endif

  // Store the preferred sample rate and preferred number of channels already

  // here. They have not been set and confirmed yet since configureForWebRTC

  // is not called until audio is about to start. However, it makes sense to

  // store the parameters now and then verify at a later stage.

  RTCAudioSessionConfiguration* config =

      [RTCAudioSessionConfiguration webRTCConfiguration];

  playout_parameters_.reset(config.sampleRate,

                            config.outputNumberOfChannels);

  record_parameters_.reset(config.sampleRate,

                           config.inputNumberOfChannels);

  // Ensure that the audio device buffer (ADB) knows about the internal audio

  // parameters. Note that, even if we are unable to get a mono audio session,

  // we will always tell the I/O audio unit to do a channel format conversion

  // to guarantee mono on the "input side" of the audio unit.

  UpdateAudioDeviceBuffer();

  initialized_ = true;

  return InitStatus::OK;

}


2> as currently build_ios_libs.sh does not work ever since moved from GYP to GN (https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/discuss-webrtc/rh9YqNNH23Q/rVAUs2BACAAJ), I created a static WebRTC library by merging all libraries under out/Release-iphoneos/obj and then created a signle fat binary supporting all architectures after compilation using GN.


Also i am wondering if this issue is related to https://groups.google.com/forum/#!searchin/discuss-webrtc/RTCAudioSessionConfiguration%7Csort:relevance/discuss-webrtc/YATXL6VGySg/Udym5pVFCAAJ because only difference is runtime issue or not.


Any suggestions?

Nuno Jun

unread,
Oct 5, 2016, 4:44:51 AM10/5/16
to discuss-webrtc
It turned out that this issue was caused by ldfalg "-force_load" option in my application. Changed it to "-ObjC" and it is working fine now. Please refer to below for more information.


Alexander Widerberg

unread,
Feb 22, 2017, 9:33:35 AM2/22/17
to discuss-webrtc
Yes! 
Thanks for submitting this find! Helped me on 10.2 as well!
Reply all
Reply to author
Forward
0 new messages