I tried to create restart with react-native-restart, but I get an error when calling RNRestart.Restart():
[Unhandled promise rejection: TypeError: null is not an object (evaluating '_reactNativeRestart.default.Restart')]
How do I implement reload in production ?
p.s. I use expo
you can use expo-updates just run expo install expo-updates and restart the app with the method reloadAsync
import * as Updates from 'expo-updates';
Updates.reloadAsync()
Related
After upgrading to Expo 46, suddenly I started seeing these errors. I have searched on them, but did not find a solution so far. The app doesn't start anymore, it directly shows these errors.
Any ideas?
ERROR TypeError: undefined is not an object (evaluating '_reactNative.Image.propTypes.source')
Error: Unable to resolve module ./http://192.168.xx.xx:19000/index.ts from C:\xx/.:
None of these files exist:
* http:\192.168.xx.xx:19000\index.ts(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.svg|.native.svg|.svg|.android.cjs|.native.cjs|.cjs)
* http:\192.168.xx.xx:19000\index.ts\index(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.svg|.native.svg|.svg|.android.cjs|.native.cjs|.cjs)
at ModuleResolver.resolveDependency (C:\xx\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:136:15)
at DependencyGraph.resolveDependency (C:\xx\node_modules\metro\src\node-haste\DependencyGraph.js:231:43)
at C:\xx\node_modules\metro\src\lib\transformHelpers.js:129:24
at Server._resolveRelativePath (C:\xx\node_modules\metro\src\Server.js:1137:12)
at async Server.requestProcessor [as _processBundleRequest] (C:\xx\node_modules\metro\src\Server.js:464:37)
at async Server._processRequest (C:\xx\node_modules\metro\src\Server.js:420:9)
ERROR Invariant Violation: "main" has not been registered. This can happen if:
* Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called
I solved the issue by divide and conquer strategy.
Commenting out every component and uncommenting them step by step until I found the issue.
In my case it was one of my plugins react-native-qrcode-svg, which needed to be updated in order to support the Expo 46 upgrade.
I have been trying to implement this plugin using the cli in my Vue app (Vue 3)
vue add prerender-spa
. After I am done with the cli, I get this error.
� Invoking generator for Vue-cli-plugin-prerender-spa...
⚓ Running completion hooks...
ERROR TypeError: Cannot read property 'endsWith' of undefined
TypeError: Cannot read property 'endsWith' of undefined
at C:\Users\hp\Documents\WebDev\projects\VueAndFirebase\learnvue\Myprerender-attempt\dojo-blog\node_modules\vue-cli-plugin-prerender-spa\generator.js:22:42
at runGenerator (C:\Users\hp\AppData\Roaming\npm\node_modules\#vue\cli\lib\invoke.js:132:13)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async invoke (C:\Users\hp\AppData\Roaming\npm\node_modules\#vue\cli\lib\invoke.js:92:3)
What could be the problem, or should I just abandon this pre-rendering and focus on SSR(Nuxt.js). Although the app is a small one and based on my findings, SSR is overkill. It is giving me too much headache.
I have a private gitlab repo (react native module) and i added this repo to my App's package.json.
index file in my private gitlab repo:
ios methods:
android methods:
Now in my App, i install the above module and i call the methods.
App's package.json
App.js
In ios, everything works perfectly fine.
Both "multiply" (HealthLibrary.multiply()] and "requestAuthorization" [HealthLibrary.requestAuthorization()] work fine.
But when i run "react-native run-android", the build is successful but the display is a blank screen with this error in the log
TypeError: null is not an object (evaluating 'nativeModule.requestAuthorization')
Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
Why does this error pop up only when i run android??i am not even calling "requestAuthorization" method yet i am unable to build the app in Android.
Any help would be great guys....
In the images you have provided, there seems to be no requestAuthorization method in your android file, only a method called 'getAuthorization'.
The maps library works fine in a old project with react native where react-native version is 0.55.3 and react native maps is 0.23.0
In a new project after setting up, Android that is, while building the app I keep getting the following error:
info JS server already running.
info Building and installing the app on the device (cd android && ./gradlew app:installAgroShopDebug)...
> Configure project :app
WARNING: API 'variant.getAssemble()' is obsolete and has been replaced with 'variant.getAssembleProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getAssemble(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
> Task :react-native-maps:checkDebugManifest FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-maps:checkDebugManifest'.
> Failed to create parent directory '/home/shockwav3/Downloads/mFarming/newRN/mFarming/node_modules/react-native-maps/lib/android/build/intermediates/check_manifest_result' when creating directory '/home/shockwav3/Downloads/mFarming/newRN/mFarming/node_modules/react-native-maps/lib/android/build/intermediates/check_manifest_result/debug/checkDebugManifest/out'
Help would be very much appreciated.
I faced a similar issue when I upgraded react-native. Strangely I fixed it by running metro with sudo
When i try to install my react native app on device it shows following error :-
Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
com.android.build.api.transform.TransformException: com.android.builder.dexing.DexArchiveBuilderException: com.android.builder.dexing.DexArchiveBuilderException: Failed to process /home/user28/.gradle/caches/transforms-1/files-1.1/exoplayer-core-2.9.1.aar/227c237efe9029fa4a76003d6795431d/jars/classes.jar
And i could not understand how to solve it. My app runs correctly but after installing react-native-video dependency it shows following error.Help me to get out from this.
Add the following to your app/build.gradle file:
android {
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
}
}