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

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

Open
lingyunzhu opened this issue Dec 12, 2018 · 10 comments
Open

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

lingyunzhu opened this issue Dec 12, 2018 · 10 comments

Comments

@lingyunzhu
Copy link

初始化代码如下:
// 初始化直播模块
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
Copy link

lodgkk commented Feb 13, 2019

同上,解决了吗?

@1771893348
Copy link

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

@zhoulongwu11
Copy link

    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
Copy link
Collaborator

xkazer commented Nov 5, 2019

    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
Copy link

    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
Copy link

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

@xkazer
Copy link
Collaborator

xkazer commented Nov 6, 2019

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

@zhoulongwu11
Copy link

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

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

@zhoulongwu11
Copy link

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

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

@xkazer
Copy link
Collaborator

xkazer commented Nov 6, 2019

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

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

5 participants