尝试在我的应用程序中使用Quickblox。 Multidex apk文件正确生成。 但是,在尝试获取QbUsers类时存在运行时问题。
以下是代码:
QBUsers.getUsersByIDs(usersIDs, requestBuilder, new QBEntityCallbackImpl<ArrayList<QBUser>>() {
@Override
public void onSuccess(ArrayList<QBUser> users, Bundle params) {
// Save users
//
((ApplicationSingleton) getApplication()).setDialogsUsers(users);
Map<Integer, QBUser> usermap = ((ApplicationSingleton) getApplication()).getDialogsUsers();
for(Integer key:usermap.keySet()) {
Toast.makeText(UnjoinClubActivity.this, "SenderFullName = " + usermap.get(key).getFullName() + " " + usermap.get(key).getId(), Toast.LENGTH_LONG).show();
}
// build list view
//?
// buildListView(dialogs);
}
例外:
java.lang.NoClassDefFoundError: com.quickblox.module.users.model.QBUser
at com.sc.triumph.chatsingleton.ApplicationSingleton.setDialogsUsers(ApplicationSingleton.java:51)
at com.sc.triumph.activities.UnjoinClubActivity$4$1.onSuccess(UnjoinClubActivity.java:394)
at com.sc.triumph.activities.UnjoinClubActivity$4$1.onSuccess(UnjoinClubActivity.java:387)
at com.quickblox.core.query.Query.notifySuccess(Query.java:307)
at com.quickblox.core.query.Query$VersionEntityCallback.completedWithResponse(Query.java:339)
at com.quickblox.core.query.Query.completedWithResponse(Query.java:253)
at com.quickblox.core.server.HttpRequestRunnable$1.handleMessage(HttpRequestRunnable.java:38)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4963)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
at dalvik.system.NativeStart.main(Native Method)
java.lang.NoClassDefFoundError:com.quickblox.module.users.model.QBUser 在com.sc.triumph.chatsingleton.ApplicationSingleton.setDialogsUsers(ApplicationSingleton.java:51) at com.sc.triumph.activities.UnjoinClubActivity $ 4 $ 1.onSuccess(UnjoinClubActivity.java:394) at com.sc.triumph.activities.UnjoinClubActivity $ 4 $ 1.onSuccess(UnjoinClubActivity.java:387) 在com.quickblox.core.query.Query.notifySuccess(Query.java:307) 在com.quickblox.core.query.Query $ VersionEntityCallback.completedWithResponse(Query.java:339) 在com.quickblox.core.query.Query.completedWithResponse(Query.java:253) 在com.quickblox.core.server.HttpRequestRunnable $ 1.handleMessage(HttpRequestRunnable.java:38) 在android.os.Handler.dispatchMessage(Handler.java:99) 在android.os.Looper.loop(Looper.java:137) 在android.app.ActivityThread.main(ActivityThread.java:4963) at java.lang.reflect.Method.invokeNative(Native Method) 在java.lang.reflect.Method.invoke(Method.java:511) 在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:1038) 在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805) 在dalvik.system.NativeStart.main(本地方法)
如果在非multidex应用程序中使用相同的功能,它可以正常工作。
期待帮助了解可能出现的问题?