当我按下按钮时 Smooch 崩溃了
Smooch crashes when I press the button
这是我得到的错误:
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)
这就是我在应用程序中初始化的方式 class:
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);
感谢 RRR,我发现了这个:https://github.com/smooch/smooch-android/issues/22 表明他们启动了一个错误的版本,如果你使用 2.2.0 而不是最新版本,它将工作
已发布新版 SDK (2.3.1),修复了该问题。
这是我得到的错误:
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)
这就是我在应用程序中初始化的方式 class:
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);
感谢 RRR,我发现了这个:https://github.com/smooch/smooch-android/issues/22 表明他们启动了一个错误的版本,如果你使用 2.2.0 而不是最新版本,它将工作
已发布新版 SDK (2.3.1),修复了该问题。