zhaoyang21cn / iLiveSDK_Android_Suixinbo

ILiveSDK samples
250 stars 86 forks source link

更新到1.9.6后,初始化奔溃 #97

Open lingyunzhu opened 5 years ago

lingyunzhu commented 5 years ago

初始化代码如下: // 初始化直播模块 ILVLiveConfig liveConfig = new ILVLiveConfig(); liveConfig.setLiveMsgListener(MessageEvent.getInstance()); ILVLiveManager.getInstance().init(liveConfig);//奔溃发生在该行

UncaughtException detected: java.lang.NoSuchMethodError: No virtual method getRoomMessageListener()Lcom/tencent/TIMMessageListener; in class Lcom/tencent/livesdk/ILVLiveConfig; or its super classes (declaration of 'com.tencent.livesdk.ILVLiveConfig' appears in /data/app/cn.edoctor.android.talkmed-2/base.apk:classes4.dex) at com.tencent.livesdk.LiveMgr.init(LiveMgr.java:41)

lodgkk commented 5 years ago

同上,解决了吗?

1771893348 commented 5 years ago

在初始化前加ILiveSDK.getInstance().setChannelMode(CommonConstants.E_ChannelMode.E_ChannelIMSDK);

zhoulongwu11 commented 5 years ago
    ILiveSDK.getInstance().setChannelMode(CommonConstants.E_ChannelMode.E_ChannelIMSDK);
    //初始化avsdk imsdk
    TIMManager.getInstance().disableBeaconReport();
    TIMManager.getInstance().setLogLevel(TIMLogLevel.WARN);
    // 初始化ILiveSDK
    ILiveLog.setLogPrint(false);
    ILiveSDK.getInstance().initSdk(context, LiveConstants.SDK_APPID, LiveConstants.ACCOUNT_TYPE);
    // 初始化直播模块
    ILVLiveConfig liveConfig = new ILVLiveConfig();
    liveConfig.setLiveMsgListener(LiveMessageHelper.getInstance());
    ILVLiveManager.getInstance().init(liveConfig);//此处报错
    //初始化CrashReport系统
    CrashHandler crashHandler = CrashHandler.getInstance();
    crashHandler.init(context);

这不是写在初始化之前嘛,咋还是报错啊,我好难啊!

xkazer commented 5 years ago
    ILiveSDK.getInstance().setChannelMode(CommonConstants.E_ChannelMode.E_ChannelIMSDK);
    //初始化avsdk imsdk
    TIMManager.getInstance().disableBeaconReport();
    TIMManager.getInstance().setLogLevel(TIMLogLevel.WARN);
    // 初始化ILiveSDK
    ILiveLog.setLogPrint(false);
    ILiveSDK.getInstance().initSdk(context, LiveConstants.SDK_APPID, LiveConstants.ACCOUNT_TYPE);
    // 初始化直播模块
    ILVLiveConfig liveConfig = new ILVLiveConfig();
    liveConfig.setLiveMsgListener(LiveMessageHelper.getInstance());
    ILVLiveManager.getInstance().init(liveConfig);//此处报错
    //初始化CrashReport系统
    CrashHandler crashHandler = CrashHandler.getInstance();
    crashHandler.init(context);

这不是写在初始化之前嘛,咋还是报错啊,我好难啊!

具体是什么错误?需要注意的是 ILVLiveConfig/ILVLiveManager这些类不是ilivesdk的接口,而是已经不再维护的livesdk的接口

zhoulongwu11 commented 5 years ago
    ILiveSDK.getInstance().setChannelMode(CommonConstants.E_ChannelMode.E_ChannelIMSDK);
    //初始化avsdk imsdk
    TIMManager.getInstance().disableBeaconReport();
    TIMManager.getInstance().setLogLevel(TIMLogLevel.WARN);
    // 初始化ILiveSDK
    ILiveLog.setLogPrint(false);
    ILiveSDK.getInstance().initSdk(context, LiveConstants.SDK_APPID, LiveConstants.ACCOUNT_TYPE);
    // 初始化直播模块
    ILVLiveConfig liveConfig = new ILVLiveConfig();
    liveConfig.setLiveMsgListener(LiveMessageHelper.getInstance());
    ILVLiveManager.getInstance().init(liveConfig);//此处报错
    //初始化CrashReport系统
    CrashHandler crashHandler = CrashHandler.getInstance();
    crashHandler.init(context);

这不是写在初始化之前嘛,咋还是报错啊,我好难啊!

具体是什么错误?需要注意的是 ILVLiveConfig/ILVLiveManager这些类不是ilivesdk的接口,而是已经不再维护的livesdk的接口

java.lang.NoSuchMethodError: No virtual method getRoomMessageListener()Lcom/tencent/TIMMessageListener; in class Lcom/tencent/livesdk/ILVLiveConfig; or its super classes (declaration of 'com.tencent.livesdk.ILVLiveConfig' appears in /data/app/com.intexh.doctoronline-1/split_lib_dependencies_apk.apk) at com.tencent.livesdk.LiveMgr.init(LiveMgr.java:41) at com.intexh.doctoronline.module.live.helper.InitBusinessHelper.initApp(InitBusinessHelper.java:43) at com.intexh.doctoronline.module.main.MainActivity.init(MainActivity.java:184) at com.intexh.doctoronline.base.AppBaseActivity.onCreate(AppBaseActivity.java:50) at android.app.Activity.performCreate(Activity.java:5990) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2280) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2392) at android.app.ActivityThread.access$800(ActivityThread.java:153) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1305) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5293) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 错误信息

zhoulongwu11 commented 5 years ago

走到ILVLiveManager.getInstance().init(liveConfig);会进LiveMgr这个直播接口实现类的public int init(ILVLiveConfig config)方法,方法中的第一个判断就直接报错 if (config.getRoomMessageListener() == null)

xkazer commented 5 years ago

不要使用livesdk了,已经不再维护了,可以直接使用ilivesdk,用ILiveRoomManager

zhoulongwu11 commented 5 years ago

不要使用livesdk了,已经不再维护了,可以直接使用ilivesdk,用ILiveRoomManager

好的我试试,有没有最新的demo啊 我看git上的demo是以前老版本的!

zhoulongwu11 commented 5 years ago

不要使用livesdk了,已经不再维护了,可以直接使用ilivesdk,用ILiveRoomManager

如果不使用livesdk,则不能使用信令,ilivesdk里面有代替类嘛!

xkazer commented 5 years ago

ilivesdk可以用sendGroupMessage发送群组消息,信令可以自己封装