I am trying to upgrade Apptentive from 1.7.3 version to latest 2.1.1 version.
However whenever I call method
Apptentive.showMessageCenter(getActivity()), to launch Apptentive message dialog, it crashes and gives NoClassDefFoundError for ViewActivity.
Logs are as below:
java.lang.NoClassDefFoundError: com.apptentive.android.sdk.ViewActivity
01-08 11:30:41.837 E/AndroidRuntime(30049): at com.apptentive.android.sdk.module.engagement.EngagementModule.launchInteraction(EngagementModule.java:75)
01-08 11:30:41.837 E/AndroidRuntime(30049): at com.apptentive.android.sdk.module.engagement.EngagementModule.doEngage(EngagementModule.java:64)
01-08 11:30:41.837 E/AndroidRuntime(30049): at com.apptentive.android.sdk.module.engagement.EngagementModule.engage(EngagementModule.java:53)
01-08 11:30:41.837 E/AndroidRuntime(30049): at com.apptentive.android.sdk.module.engagement.EngagementModule.engageInternal(EngagementModule.java:31)
01-08 11:30:41.837 E/AndroidRuntime(30049): at com.apptentive.android.sdk.ApptentiveInternal.showMessageCenterInternal(ApptentiveInternal.java:191)
01-08 11:30:41.837 E/AndroidRuntime(30049): at com.apptentive.android.sdk.Apptentive.showMessageCenter(Apptentive.java:635)
01-08 11:30:41.837 E/AndroidRuntime(30049): at com.apptentive.android.sdk.Apptentive.showMessageCenter(Apptentive.java:619)
My code in build.gradle file is:
compile 'com.apptentive:apptentive-android:2.1.1@aar'
and java code is:
Button writeUs = (Button) fitnessSyncDialog.findViewById(R.id.button_click_write_us);
writeUs.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Apptentive.showMessageCenter(getActivity());
}
});
Same code is working with 1.7.3 version. has anyone faced this problem or Can anyone suggest what problem can be here?
Thanks in advance for any valuable suggestions.
It is possible that you did not include a reference to ViewActivity in your app's manifest. for example:
Another possibility is that you did not include a reference to the Apptentive aar in your build.gradle . For example:
More info can be found here http://www.apptentive.com/docs/android/integration/