apptentive / apptentive-react-native

Apptentive SDK module for React Native
https://learn.apptentive.com/article-categories/react-native/
BSD 3-Clause "New" or "Revised" License
15 stars 19 forks source link

Android Crashes after updating to 6.1.1 #228

Closed galengeocaching closed 11 months ago

galengeocaching commented 1 year ago

Our Android App is crashing in Production after updating from 6.0.9 to 6.1.1:

apptentive.com.android.util.Log.<clinit>
java.lang.IllegalArgumentException: Provider is not registered: interface apptentive.com.android.core.n

I believe we are crashing due to a call to Apptentive.addCustomPersonData near startup. Is it possible to make this as before where this results in a no-op if the Apptentive registration is not yet complete rather than a full crash?

java.lang.RuntimeException: Could not invoke ApptentiveModule.addCustomPersonDataNumber
  at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:383)
  at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
  at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java:-2)
  at android.os.Handler.handleCallback(Handler.java:751)
  at android.os.Handler.dispatchMessage(Handler.java:95)
  at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
  at android.os.Looper.loop(Looper.java:154)
  at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
  at java.lang.Thread.run(Thread.java:762)
  Caused by: java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Method.invoke(Method.java:-2)
    at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
    at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
    at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java:-2)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
    at android.os.Looper.loop(Looper.java:154)
    at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
    at java.lang.Thread.run(Thread.java:762)
    Caused by: java.lang.ExceptionInInitializerError
      at apptentive.com.android.util.Log.e(Log.java:-1:-1)
      at apptentive.com.android.feedback.Apptentive.addCustomPersonData(Apptentive.java:743)
      at com.apptentive.android.sdk.reactlibrary.ApptentiveModule.addCustomPersonDataNumber(ApptentiveModule.java:162)
      at java.lang.reflect.Method.invoke(Method.java:-2)
      at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
      at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
      at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java:-2)
      at android.os.Handler.handleCallback(Handler.java:751)
      at android.os.Handler.dispatchMessage(Handler.java:95)
      at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
      at android.os.Looper.loop(Looper.java:154)
      at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
      at java.lang.Thread.run(Thread.java:762)
      Caused by: java.lang.IllegalArgumentException: Provider is not registered: interface apptentive.com.android.core.n
        at apptentive.com.android.util.Log.<clinit>(Log.java:111)
        at apptentive.com.android.util.Log.e(Log.java:-1:-1)
        at apptentive.com.android.feedback.Apptentive.addCustomPersonData(Apptentive.java:743)
        at com.apptentive.android.sdk.reactlibrary.ApptentiveModule.addCustomPersonDataNumber(ApptentiveModule.java:162)
        at java.lang.reflect.Method.invoke(Method.java:-2)
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
        at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java:-2)
        at android.os.Handler.handleCallback(Handler.java:751)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
        at android.os.Looper.loop(Looper.java:154)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
        at java.lang.Thread.run(Thread.java:762)
galengeocaching commented 1 year ago

I'm testing patching in try/catches for the addCustomPersonData{type} functions in android/src/main/java/com/apptentive/android/sdk/reactlibrary/ApptentiveModule.kt

galengeocaching commented 11 months ago

Issue resolved after 6.1.3 update.