美文网首页
iOS端编译anyRTC-RTMP-OpenSource直播库

iOS端编译anyRTC-RTMP-OpenSource直播库

作者: Alexander | 来源:发表于2023-05-03 10:40 被阅读0次

    一, anyRTC-RTMP-OpenSource下载后并不能直接运行,需要做一下配置

    • 1, 勾选Automatically manage signing
    • 2, 勾选后选择对应的Team, 会报以下错误
    Failed to register bundle identifier
    1. The app identifier 'com.dync.rtmpc' cannot be registered to your development team because it is not available. Change your bundle identifier to a unique string to try again.
    
    2. Provisioning profile "iOS Team Provisioning Profile: *" doesn't support the App Groups capability.
    
    3. Provisioning profile "iOS Team Provisioning Profile: *" doesn't support the group.anyrtc.live App Group.
    
    4. Provisioning profile "iOS Team Provisioning Profile: *" doesn't include the com.apple.security.application-groups entitlement.
    
    
    1. 解决这个问题需要设置正确的证书, 证书中要勾选App Groups, 然后设置正确的Bundle Identifier (eg: com.xxx.123)
    2. 删除项目中的App Groups, 重新点击+Capability, 选择App Groups,点击+,并设置标识(eg: com.xxx.123)
    3. ARLiveLibraryARLiveKit的签名配置方式一样

    二, 签名证书等配置完毕运行后ARLiveLibrary会报以下错误

    Unknown type name 'NSString'
    Unknown type name 'NSString'
    Unknown type name 'NSString'
    Unknown type name 'NSString'
    Unknown type name 'NSString'
    Unknown type name 'NSString'
    Unknown type name 'NSString'
    Expected unqualified-id
    too many errors emitted, stopping now
    

    错误原因是项目中的静态库添加了C++的源文件,所以需要在iOS的项目中需要配置Compile Sources AsObjective-C++

    三, 项目基础配置设置了Objective-C++Unknown type name 'NSString'的报错得以解决, 但又会出现新的问题Assigning to 'const uint8_t *' (aka 'const unsigned char *') from incompatible type 'const void *'. 具体问题就是赋值时类型不对, 需要进行类型转换.

    // 错误类型一: 类型转换
        int r;
        const uint8_t* p;
    
    //  p = data;  // 错误类型
        p = static_cast<const uint8_t*>(data); // 类型需要保持一致
    
    // 类型错误二: 强制类型转换
      double totvol = 0.0;
      double totchg, totchg2;
    //  psydata_t *psydata = psyInfo->data; // 改之前会报错
        psydata_t *psydata = (psydata_t *)psyInfo->data; // 改之后, 强制类型转换
    

    备注: 其他类型错误解决方法一致, 进行类型转换或强制类型转换.

    总结: 至此基础配置和错误都解决完,可以正常运行起来,需要留意的是创建证书的时候需要勾选App Group. 然后在项目中配置App Group.

    相关文章

      网友评论

          本文标题:iOS端编译anyRTC-RTMP-OpenSource直播库

          本文链接:https://www.haomeiwen.com/subject/vqcijdtx.html