Open shiv71 opened 2 years ago
@shiv71 hi, which demo are you running? or it's your own project? if it's your own project, could you pls share the minima reproducible project with us? cheers
It's our own project and we have an account on the agora and we are paid users. Our project is large and according to NDA, we can not share the project.
We are using below agora sdk implementation 'io.agora.rtc:full-sdk:3.6.0.1' implementation "io.agora.rtm:rtm-sdk:1.4.0"
I used https://github.com/AgoraIO/RTM/tree/master/Agora-RTM-Tutorial-Android for RTM code reference. I have copied the ChatManager class from the above code sample and used the same as like above sample app and sometimes throw an exception (throw new RuntimeException("NEED TO check rtm sdk init fatal error\n" + Log.getStackTraceString(e))) in the init() method in our play store app.
public void init() {
String appID = mContext.getString(R.string.agora_app_id);
try {
mRtmClient = RtmClient.createInstance(mContext, appID, new RtmClientListener() {
@Override
public void onConnectionStateChanged(int state, int reason) {
for (RtmClientListener listener : mListenerList) {
listener.onConnectionStateChanged(state, reason);
}
}
@Override
public void onMessageReceived(RtmMessage rtmMessage, String peerId) {
if (mListenerList.isEmpty()) {
// If currently there is no callback to handle this
// message, this message is unread yet. Here we also
// take it as an offline message.
mMessagePool.insertOfflineMessage(rtmMessage, peerId);
} else {
for (RtmClientListener listener : mListenerList) {
listener.onMessageReceived(rtmMessage, peerId);
}
}
}
@Override
public void onImageMessageReceivedFromPeer(final RtmImageMessage rtmImageMessage, final String peerId) {
if (mListenerList.isEmpty()) {
// If currently there is no callback to handle this
// message, this message is unread yet. Here we also
// take it as an offline message.
mMessagePool.insertOfflineMessage(rtmImageMessage, peerId);
} else {
for (RtmClientListener listener : mListenerList) {
listener.onImageMessageReceivedFromPeer(rtmImageMessage, peerId);
}
}
}
@Override
public void onFileMessageReceivedFromPeer(RtmFileMessage rtmFileMessage, String s) {
}
@Override
public void onMediaUploadingProgress(RtmMediaOperationProgress rtmMediaOperationProgress, long l) {
}
@Override
public void onMediaDownloadingProgress(RtmMediaOperationProgress rtmMediaOperationProgress, long l) {
}
@Override
public void onTokenExpired() {
}
@Override
public void onPeersOnlineStatusChanged(Map<String, Integer> status) {
}
});
if (BuildConfig.DEBUG) {
mRtmClient.setParameters("{\"rtm.log_filter\": 65535}");
}
} catch (Exception e) {
Log.e(TAG, Log.getStackTraceString(e));
throw new RuntimeException("NEED TO check rtm sdk init fatal error\n" + Log.getStackTraceString(e));
}
// Global option, mainly used to determine whether
// to support offline messages now.
mSendMsgOptions = new SendMessageOptions();
}
Tell me if you want any other information.
@plutoless have you look this issue.
@shiv71 sorry for late response. what params did you pass when create rtm instance? also does it work if you run our demo directly?
@plutoless I am passing context and agora app id. It is working fine in your demo and our app but we got two users crashing in our play store app in firebase crashlytics.
@shiv71 ok i see. so it's not constantly reproducible but only happening randomly on your online apps?
@plutoless Yes, you are right.
Getting crash in Firebase crashlytics when initializing agora RTM SDK.
cannot initialize Agora RTM Service, error: 1