sp-react-native-in-app-updates
sp-react-native-in-app-updates copied to clipboard
java.lang.RuntimeException: Could not invoke SpInAppUpdates.checkNeedsUpdate
This error is happening using the abb or apk in the smart FATAL EXCEPTION: mqt_native_modules Process: com.app, PID: 27571 java.lang.RuntimeException: Could not invoke SpInAppUpdates.checkNeedsUpdate
can you provide a full stacktrace please? 🙏
can you provide a full stacktrace please? 🙏
Yes:
FATAL EXCEPTION: mqt_native_modules
Process: com.dixtra.app, PID: 27571
java.lang.RuntimeException: Could not invoke SpInAppUpdates.checkNeedsUpdate
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:383)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
at com.facebook.jni.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:888)
at android.os.Handler.dispatchMessage(Handler.java:100)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loop(Looper.java:213)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
at java.lang.Thread.run(Thread.java:929)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
at com.facebook.jni.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:888)
at android.os.Handler.dispatchMessage(Handler.java:100)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loop(Looper.java:213)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
at java.lang.Thread.run(Thread.java:929)
Caused by: java.lang.NoSuchMethodError: No interface method getAppUpdateInfo()Lcom/google/android/gms/tasks/Task; in class Lcom/google/android/play/core/appupdate/AppUpdateManager; or its super classes (declaration of 'com.google.android.play.core.appupdate.AppUpdateManager' appears in /data/app/com.dixtra.zenks.nippydelivery-4dwakNCSSSLl9bdgD3DMew==/base.apk!classes2.dex)
at com.sudoplz.rninappupdates.SpReactNativeInAppUpdatesModule.checkNeedsUpdate(SpReactNativeInAppUpdatesModule.java:93)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
at com.facebook.jni.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:888)
at android.os.Handler.dispatchMessage(Handler.java:100)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loop(Looper.java:213)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
at java.lang.Thread.run(Thread.java:929)
@SudoPlz We are also facing the same issue
Unhandled error
Error: sp-react-native-in-app-updates startUpdate error: Error: Update type unavailable, check checkNeedsUpdate.isImmediateUpdateAllowed or checkNeedsUpdate.isFlexibleUpdateAllowed first.
node_modules/sp-react-native-in-app-updates/src/InAppUpdatesBase.ts:20:10 anonymous
node_modules/sp-react-native-in-app-updates/src/InAppUpdates.android.ts:184:6 anonymous
/tmp/hermes/staging/hermes/cmake/intlRelease/armeabi-v7a/lib/InternalBytecode/InternalBytecode.js:53:16 tryCallOne
/tmp/hermes/staging/hermes/cmake/intlRelease/armeabi-v7a/lib/InternalBytecode/InternalBytecode.js:139:27 anonymous
(native) apply
node_modules/react-native/Libraries/Core/Timers/JSTimers.js:248:12 anonymous
node_modules/react-native/Libraries/Core/Timers/JSTimers.js:112:14 _callTimer
node_modules/react-native/Libraries/Core/Timers/JSTimers.js:166:14 _callReactNativeMicrotasksPass
node_modules/react-native/Libraries/Core/Timers/JSTimers.js:418:41 callReactNativeMicrotasks
node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:393:6 __callReactNativeMicrotasks
node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:135:6 anonymous
node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:370:10 __guard
node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:134:4 flushedQueue
node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:130:11 invokeCallbackAndReturnFlushedQueue
@frzkn any update on this thread?
Any update on this ?
Still facing the same
@SudoPlz any updates? i'm also facing this issue
Guys this is a super generic issue, which I can't repro.
Essentially what this error is saying is, hey, I can't find the checkNeedsUpdate method from the native in-app-updates module.
I don't know why that may be happening, it requires generic troubleshooting react-native knowledge to figure it out and my best guess would be that it's super specific to your project & environment (maybe the native module is not found for whatever reason ? expo project perhaps? fabric enabled?).
Can someone create a sample project that showcases the issue?
I will try create a repro when time allows. As a temporary solution, I found downgrading to v1.1.0 lets me use that function without any issues (my project is on v67.5 of react native)
I would look at the trace at the native level, given in the stack trace above:
Caused by: java.lang.NoSuchMethodError: No interface method getAppUpdateInfo()Lcom/google/android/gms/tasks/Task; in class Lcom/google/android/play/core/appupdate/AppUpdateManager; or its super classes (declaration of 'com.google.android.play.core.appupdate.AppUpdateManager' appears in /data/app/com.dixtra.zenks.nippydelivery-4dwakNCSSSLl9bdgD3DMew==/base.apk!classes2.dex)
any fix related to this issue? We are also facing same issue in rn 0.72.2
any fix related to this issue? I am also facing same issue in rn 0.73.6