これは私が得るエラーです:
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);