Good morning.
On August 26th of this year, I published a version of an app built with React-Native. Everything went smoothly, and the internal test reports sent by the store did not show any issues. However, on September 27th, when launching a new version, Google Play Console reported undefined is not a function
error for the following devices below.
Since I do not have these devices physically, I downloaded emulators for the specified Android versions and ran the app natively, using the Android folder. However, I was unable to replicate the issue.
I searched through every part of the code for something that could be causing the problem, but I couldn’t find anything wrong.
I then began to suspect that the issue might not lie in my logic. So, I decided to remove all logic entirely. The only change made was updating the project version; everything else was exactly the same as the stable version from August 26th, including the files package-lock.json
, package.json
, and yarn.lock
.
To publish the app, I executed the command cd android && ./gradlew clean
to clean all the build files in the Android folder. Then, I deleted the entire node_modules
folder and regenerated it to ensure there were no corrupted packages. After that, I ran the command ./gradlew bundleRelease
to generate the package in AppBundle format for release.
And guess what: the stable version, which had not reported any problems when published on August 26th, now presented the same issue: undefined is not a function
.
I updated the packages using yarn upgrade
, but the error still persisted.
I’ve read every type of forum about this issue, but most of them stated it was a code error. Unfortunately, I no longer know how to proceed. How is it possible for a version with the same code to start showing issues out of nowhere, especially when no errors were detected in the pre-launch report the first time it was published?
Below is the error reported by the Play Console.
Exception com.facebook.react.common.JavascriptException: TypeError: undefined is not a function
This error is located at:
in App
in Router
in RouterComponent
in Connect(RouterComponent)
in Provider
in App
in RCTView
in Unknown
in AppContainer, js engine: hermes, stack:
componentWillUnmount@1:738353
commitDeletionEffectsOnFiber@1:410510
recursivelyTraverseDeletionEffects@1:410175
commitDeletionEffectsOnFiber@1:410734
recursivelyTraverseDeletionEffects@1:410175
commitDeletionEffectsOnFiber@1:410547
recursivelyTraverseDeletionEffects@1:410175
commitDeletionEffectsOnFiber@1:410734
recursivelyTraverseDeletionEffects@1:410175
commitDeletionEffectsOnFiber@1:411109
recursivelyTraverseDeletionEffects@1:410175
commitDeletionEffectsOnFiber@1:410734
recursivelyTraverseDeletionEffects@1:410175
commitDeletionEffectsOnFiber@1:410547
recursivelyTraverseDeletionEffects@1:410175
commitDeletionEffectsOnFiber@1:410887
recursivelyTraverseDeletionEffects@1:410175
commitDeletionEffectsOnFiber@1:410734
recursivelyTraverseDeletionEffects@1:410175
commitDeletionEffectsOnFiber@1:411109
recursivelyTraverseDeletionEffects@1:410175
commitDeletionEffectsOnFiber@1:410734
recursivelyTraverseDeletionEffects@1:410175
commitDeletionEffectsOnFiber@1:411109
recursivelyTraverseMutationEffects@1:411649
commitMutationEffectsOnFiber@1:413289
commitRootImpl@1:422844
commitRoot@1:422442
flushSyncWorkAcrossRoots_impl@1:376999
scheduleUpdateOnFiber@1:418005
updateContainer@1:427141
unmountComponentAtNode@1:427427
anonymous@1:436470
unmountComponentAtNodeAndRemoveContainer@1:108229
unmountApplicationComponentAtRootTag@1:339749
__callFunction@1:97578
anonymous@1:96018
__guard@1:96959
callFunctionReturnFlushedQueue@1:95976
at com.facebook.react.modules.core.ExceptionsManagerModule.reportException (ExceptionsManagerModule.java:65)
at java.lang.reflect.Method.invoke
at com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke (JavaModuleWrapper.java:146)
at com.facebook.jni.NativeRunnable.run
at android.os.Handler.handleCallback (Handler.java:938)
at android.os.Handler.dispatchMessage (Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (MessageQueueThreadHandler.java:27)
at android.os.Looper.loop (Looper.java:240)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run (MessageQueueThreadImpl.java:233)
at java.lang.Thread.run (Thread.java:923)
I am extremely grateful to anyone who can help me.