Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.RuntimeException: Could not invoke SpInAppUpdates.checkNeedsUpdate #151

Open
alexander0205 opened this issue Jun 30, 2023 · 11 comments

Comments

@alexander0205
Copy link

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

@SudoPlz
Copy link
Owner

SudoPlz commented Jun 30, 2023

can you provide a full stacktrace please? 🙏

@alexander0205
Copy link
Author

alexander0205 commented Jun 30, 2023

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) 

@frzkn
Copy link

frzkn commented Jul 3, 2023

@SudoPlz We are also facing the same issue

image

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

@naman312
Copy link

@frzkn any update on this thread?

@MaroofAhmedSiddique
Copy link

Any update on this ?

Still facing the same

@abdi4
Copy link

abdi4 commented Oct 17, 2023

@SudoPlz any updates? i'm also facing this issue

@SudoPlz
Copy link
Owner

SudoPlz commented Oct 17, 2023

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?

@abdi4
Copy link

abdi4 commented Oct 19, 2023

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)

@fabiendem
Copy link

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)

@anujmpec
Copy link

anujmpec commented Feb 2, 2024

any fix related to this issue? We are also facing same issue in rn 0.72.2

@khushbu-coworks
Copy link

any fix related to this issue? I am also facing same issue in rn 0.73.6

1712899646881

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants