My react-native version is 0.52.During generating the build on actual iOS device I am constantly getting error requiring unknown module '1298'.If you are sure the module is there,try restarting metro bundler.Is there any way to solve this error?
Try running this command: react-native-link && npx jetify, and then, try again with npm start --reset-cache
Related
i had everything working fine, great tool Expo. however, after updating the expo (npm i -g expo --save) i started getting this problem.
i managed to solve the invalid version issue by adding "sdkVersion": "38.0.0" to my app config - but it was working fine before that. don't know why it started appearing now. struggling to solve "unknown option `--assetExts'" issue here, could you please help ?
Warning: Problem validating app.json: Unable to perform cache refresh
for \schema-undefined.json: Error: Request failed with status code 404.
Error: Invalid sdkVersion. Valid options are 7.0.0, 8.0... 38.0.0
error: unknown option `--assetExts'
Metro Bundler process exited with code 1
Set EXPO_DEBUG=true in your env to view the stack trace.
Problem got fixed for me after updating the expo-cli to the latest version:
npm install -g expo-cli
I had the same problem, what solved it for me was clearing the react-native packager cache.
I ran: expo start --clear
Expo cli docs:
https://docs.expo.io/workflow/expo-cli/
In my package I added:
"start:clear": "expo start --clear",
just to help in the future...
I am running React-native Project by terminal using react-native run-is command. I want to run it in simulator. first I run npm install ,then react-native run-ios. It showing error
Error: Cannot find module 'metro-config'
Require stack:
- /Users/tribond/Projects/JustHelper/justhelper2/node_modules/react-native/local-cli/util/Config.js
- /Users/tribond/Projects/JustHelper/justhelper2/node_modules/react-native/local-cli/core/index.js
- /Users/tribond/Projects/JustHelper/justhelper2/node_modules/react-native/local-cli/cliEntry.js
- /Users/tribond/Projects/JustHelper/justhelper2/node_modules/react-native/local-cli/cli.js
- /Users/tribond/Projects/JustHelper/justhelper2/node_modules/react-native/cli.js
- /usr/local/lib/node_modules/react-native-cli/index.js
You seem to have no Metro-config module installed. Install this module.
npm i metro-config --save-dev
so I developed an app in react-native, already runs and tested on Android, but now its the ios part.
I'm working with react native version 0.60.3, on MacOS, using yarn as package manager.
I'm running "react-native start --reset cache".
then running "react-native run-ios:" on a separate console,
and getting this error:
"
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening app.xcworkspace.
....
error: Unable to resolve build file: XCBCore.BuildFile (missingTargetProductReference(...))
"
so then im trying to run with Xcode and i get this error on the "react-native start --reset-cache" console:
"
Error: Unable to resolve module ./index from /Users/nono/work/myapp/.: The module ./index could not be found from /Users/nono/work/myapp/.. Indeed, none of these files exist:
* /Users/nono/work/app/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)
"
and this error on the iphone simulator :
I'm desperate ... please help!
UPDATE:
now the first error doesn’t occur.
I only get the "Unable to resolve './index' ... "
error
Try to run the following commands on terminal:
npm install
cd ios; pod install; cd../
react-native link
try this:
Stop the MetroBundler/launchPackager
Delete node_modules
rm -rf node_modules
Change the version on your package.json
from
"react-native": "0.59.1",
to
"react-native": "0.58.6",
Then clean the watchman
watchman watch-del-all
Run npm install again:
npm install
And try to run your project, in my case:
react-native run-ios
My bad. I accidentally deleted the index.js ..
I have no error in my project. But the build not successfully load. see the below image. for more details for error. I am using the below command to run the build react-native run-android but the npm failed to create the build. this image directory exists and I give the correct path for images. Thanks in advance.
-root
--assets
---images
---- All Images here.
../../assets/images/sky-img.jpg use this in code.
Just closing and re-opening the cmd terminal or whatever you are using to run the metro bundler worked for me.
Just reset the cache of your Metro Bundler with:
npm start -- --reset-cache
This is happening because the bundler needs to refresh it's existing bundles and the path you previously set.
Make sure you run the command from the root directory and not from android directory.
android> cd..
project> npx react-native run-android --variant=release
I'm programming an APP using react-native, but after I pulled from github this morning, it turned out that I couldn't run it anymore. The logs in the command line are as follows:
** BUILD SUCCEEDED **
The following commands produced analyzer issues:
Analyze Base/RCTModuleMethod.mm normal x86_64
(1 command with analyzer issues)
Logs in "react-native start" command line are as follows:
error: bundling failed: TypeError: Cannot read property 'bindings' of null
at Scope.moveBindingTo (/Users/martin/Desktop/ble-server/node_modules/#babel/traverse/lib/scope/index.js:978:13)
at BlockScoping.updateScopeInfo (/Users/martin/Desktop/ble-server/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:364:17)
at BlockScoping.run (/Users/martin/Desktop/ble-server/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:330:12)
at PluginPass.BlockStatementSwitchStatementProgram (/Users/martin/Desktop/ble-server/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:70:24)
at newFn (/Users/martin/Desktop/ble-server/node_modules/#babel/traverse/lib/visitors.js:237:21)
at NodePath._call (/Users/martin/Desktop/ble-server/node_modules/#babel/traverse/lib/path/context.js:65:20)
at NodePath.call (/Users/martin/Desktop/ble-server/node_modules/#babel/traverse/lib/path/context.js:40:17)
at NodePath.visit (/Users/martin/Desktop/ble-server/node_modules/#babel/traverse/lib/path/context.js:100:12)
at TraversalContext.visitQueue (/Users/martin/Desktop/ble-server/node_modules/#babel/traverse/lib/context.js:142:16)
BUNDLE [ios, dev] ../../index.js ░░░░░░░░░░░░░░░░ 0.0% (0/1), failed.
How could I run it again, it seems that there are no issues with codes.
Please run command first:
npm start
and then
react-native run-ios
You have probably updated react-native improperly please check the documentation.
You may have used npm audit fix which updates react-native.
To fix the problem you can downgrade the react-native version of the app with
npm install react-native#x.x.x"
Then re-compile project with
react-native run-ios"
And don't forget to restart the bundler as well with
react-native start
Then, if you still want to upgrade the react-native version you can use
react-native-git-upgrade