apptentive / apptentive-android

Apptentive Android SDK
http://www.apptentive.com
BSD 3-Clause "New" or "Revised" License
65 stars 64 forks source link

Using project with android studio #63

Closed avaranovich closed 10 years ago

avaranovich commented 10 years ago

I understand this is officially not supported. However, I build a project with ant, then add jar as a dependency to my Gradle build.

When I invoke a message centre from my app, I get this exception

    java.lang.NoClassDefFoundError: com.apptentive.android.sdk.R$string
            at com.apptentive.android.sdk.model.AutomatedMessage.createWelcomeMessage(AutomatedMessage.java:56)
            at com.apptentive.android.sdk.module.messagecenter.MessageManager.createMessageCenterAutoMessage(MessageManager.java:209)
            at com.apptentive.android.sdk.Apptentive.showMessageCenter(Apptentive.java:636)
            at com.apptentive.android.sdk.Apptentive.showMessageCenter(Apptentive.java:291)

Do I miss anything?

skykelsey commented 10 years ago

Hello @avaranovich,

Since we distribute our SDK as an Android Library Project, building as a jar will not work. This is because all of the resources need to be present at compile time. If you want to integrate Apptentive into an Android Studio project, I've created a gist (https://gist.github.com/skykelsey/7712219) with instructions on how to do so. Note that I haven't tried this with the latest version of Android Studio. Please let me know if you have more questions.