按下按钮时,Smooch崩溃了

时间:2016-05-09 09:59:14

标签: android input chat messaging smooch

这是我得到的错误:

05-09 11:55:10.559: E/AndroidRuntime(15809): java.lang.NoSuchFieldError: No static field Smooch_inputText of type I in class Lio/smooch/ui/R$id; or its superclasses (declaration of 'io.smooch.ui.R$id' appears in /data/app/nl.hgrams.passenger-1/base.apk)
05-09 11:55:10.559: E/AndroidRuntime(15809):    at io.smooch.ui.fragment.ConversationFragment.onCreateView(Unknown Source)
05-09 11:55:10.559: E/AndroidRuntime(15809):    at android.support.v4.app.Fragment.performCreateView(Fragment.java:1974)
05-09 11:55:10.559: E/AndroidRuntime(15809):    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067)
05-09 11:55:10.559: E/AndroidRuntime(15809):    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252)
05-09 11:55:10.559: E/AndroidRuntime(15809):    at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:742)
05-09 11:55:10.559: E/AndroidRuntime(15809):    at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617)
05-09 11:55:10.559: E/AndroidRuntime(15809):    at android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:339)
05-09 11:55:10.559: E/AndroidRuntime(15809):    at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:602)
05-09 11:55:10.559: E/AndroidRuntime(15809):    at io.smooch.ui.ConversationActivity.onStart(Unknown Source)
05-09 11:55:10.559: E/AndroidRuntime(15809):    at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1237)
05-09 11:55:10.559: E/AndroidRuntime(15809):    at android.app.Activity.performStart(Activity.java:6268)
05-09 11:55:10.559: E/AndroidRuntime(15809):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2379)
05-09 11:55:10.559: E/AndroidRuntime(15809):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
05-09 11:55:10.559: E/AndroidRuntime(15809):    at android.app.ActivityThread.-wrap11(ActivityThread.java)
05-09 11:55:10.559: E/AndroidRuntime(15809):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
05-09 11:55:10.559: E/AndroidRuntime(15809):    at android.os.Handler.dispatchMessage(Handler.java:102)
05-09 11:55:10.559: E/AndroidRuntime(15809):    at android.os.Looper.loop(Looper.java:148)
05-09 11:55:10.559: E/AndroidRuntime(15809):    at android.app.ActivityThread.main(ActivityThread.java:5417)
05-09 11:55:10.559: E/AndroidRuntime(15809):    at java.lang.reflect.Method.invoke(Native Method)
05-09 11:55:10.559: E/AndroidRuntime(15809):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
05-09 11:55:10.559: E/AndroidRuntime(15809):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

这是我在Application类中初始化的方式:

   public void initSmooch() {
    Smooch.init(this, "c1th4qtm5o1qlm92esacfc6ow");
    UserRecord userRecord = PSUserService.getInstance(PSLocationCenter.this).getMyUser();
    if(userRecord != null) {
        User.getCurrentUser().setFirstName(userRecord.getFirst_name());
        User.getCurrentUser().setLastName(userRecord.getLast_name());
        User.getCurrentUser().setEmail(userRecord.getEmail());
        final Map<String, Object> customProperties = new HashMap<>();
        customProperties.put("country", userRecord.getCountry());
        customProperties.put("language", userRecord.getLanguage());
        customProperties.put("id", userRecord.getId());
        customProperties.put("email", userRecord.getEmail());
        User.getCurrentUser().addProperties(customProperties);
    }
}

我使用的是版本:

    compile 'io.smooch:core:latest.release'
compile 'io.smooch:ui:latest.release'

我的按钮只能执行此操作:

     ConversationActivity.show(this);

2 个答案:

答案 0 :(得分:1)

已发布新版本的SDK(2.3.1),可以解决问题。

答案 1 :(得分:0)

感谢RRR,我发现:https://github.com/smooch/smooch-android/issues/22表示他们发布了一个错误的版本,如果用户2.2.0而不是最新版本它将会有效