I'm facing an error from last day and I could not resolve this, so I decided to share on this network.
actually i started work in react-native was running application very smoothly but now I don't know what is the problem in code, by facing issue "activity class {...} does not exist", but in directory the same file on same path exist too, and as a result build failed...
see this image
Did you try to clean gradlew cache:
cd #projectDir/android
and then
./gradlew clean
Try recreating the android and ios folders and files again. "react-native upgrade" should do the work for you - provided you have not changed anything in the generated files.
npm start --reset-cache
or
react-native start --reset-cache
clean cache memory and delete the previously installed application from your device.
Related
Wanting to learn Nextjs and started by trying to go through the tutorial. Any time i 'npm run dev' local host just endlessly loads. When inspecting and checking the console I'm getting nothing at all.
Seems like nothing is coming back from the request.
Node version v16.13.1.
I've tried both npx create-next-app nextjs-blog --use-npm --example "https://github.com/vercel/next-learn/tree/master/basics/learn-starter" & npm init next-app nextjs-blog.
Any help with this will be appreciated. Thank you.
You need to actually start the process with npm run dev command from your terminal.
It worked for me
Delete the .next folder and try npm run dev command OR
Move the project to another folder location OR
Take back up of the code and delete the project and then run the same project again
You can try all of the above also
My System:
Mac OSX 10.14.6
Electron: 10.1.5
electron-forge: ^6.0.0-beta.54
I've been working on an Electron side project. I started it using electron-forge, I had a small application functioning just fine, I then set it aside for a couple weeks. Coming back to it, I tried running npm start and it did nothing but return to a new terminal line. So I tried electron-forge start and it returned bash: electron-forge: command not found.
I tried deleting my node_modules folder and reinstalling, I tried creating a new electron-forge boilerplate, and neither made a difference. I tried installing electron-forge globally, but it errored out on the second step, and I found several stackoverflow articles saying I shouldn't have electron-forge installed globally. I haven't changed anything (that I know of) on a system level, but it seems to be a system issue, rather than a package issue, but I'm not knowledgable enough to do anything other than Google the errors and see what stacksoverflow articles are out there, but no articles have helped.
I'd love any and all help, Electron has ceased working on my system completely, and I have no idea how to troubleshoot it. Thanks in advance!
I ended up deleting and re-installing Node and that seems to have fixed it. Still not sure what caused the initial issue, but it's working again. For those interested, here's the resources I used:
https://stackabuse.com/how-to-uninstall-node-js-from-mac-osx/
https://pawelgrzybek.com/install-nodejs-installer-vs-homebrew-vs-nvm/
Update:
I kept having issues running npm start. What finally worked was to create a new boilerplate project using the CLI and copy the contents of the package-lock.json to the old project. That finally launched the app.
I know this is an old question but, I had the same issue and instead of uninstalling Node, I used rm -rf node_modules then I used npm cache clean --force. I reinstalled my dependencies and electron-forge worked again.
Use the command below
npm install electron
I've built an app, also published it already. Now I want to make a small change to the app, but after starting Expo I get an error:
"Error: React Native is not installed. Please run npm install in your project directory.
Couldn't start project. Please fix the errors and restart the project."
Starting Expo (expo start) worked in the past. But starting Expo keeps failing with this error, even after running 'npm install'.
I've also tried 'expo build:android', but that also doesn't work.
All these commands are failing, also with other Expo built apps. Also an app I worked on yesterday.
What can I do to fix this?
Thanks in advance!
[edit]
I am using Expo 2.6.8. (which was a just available update)
Try updating nodejs
https://nodejs.org/en/download/
worked for me
I just upgraded to Xcode 10 and now after attempting to run my existing projects I was met with the below error. After searching I found the following issue when running react native init https://github.com/facebook/react-native/issues/21490. This solution also fixes my issue.
However I am wondering if anyone knows why my current project now require me to run the bundler as a separate instance. It's not the end of the world but it's certainly not the best experience.
Does anyone know of a way the get everything working as it was before without the need to run the following commands:
rm -rf $TMPDIR/react-; rm -rf $TMPDIR/haste-; rm -rf
$TMPDIR/metro-*; watchman watch-del-all
react-native start --reset-cache
(separate terminal) react-native run-ios
I had issues with the build after Xcode update, what I did to fix it is switch the Build System to Legacy Build System
From File > Workspace Settings
Or by pressing on the hammer icon on the right of the status bar
Change the build system to Legacy Build System
Also make sure that you still have the bundle script in Build Phases
Tell me know if that works with you
You may need to add an additional Build Phase to the xCode project after "Bundle React Native code and images"
Add a new build script by selecting the + sign on the top left and selecting "New Run Script Phase" then add the following
if nc -w 5 -z localhost 8081 ; then
if ! curl -s "http://localhost:8081/status" | grep -q "packager-
status:running" ; then
echo "Port 8081 already in use, packager is either not running or not
running correctly"
exit 2
fi
else
open "$SRCROOT/../node_modules/react-
native/scripts/launchPackager.command" || echo "Can't start packager
automatically"
fi
I have a react-native project where I changed my project name in package.json due to eslint warnings. Now when I try to run react-native link to link any library, I'm getting the following error:
Scanning folders for symlinks in /Users/my-username/projects/myproject-folder/node_modules (20ms)
rnpm-install info Linking assets to ios project
rnpm-install ERR! Something went wrong while linking. Error: ENOENT: no such file or directory, open '/Users/my-user-name/projects/myproject-folder/ios/my-old-app-name.xcodeproj/project.pbxproj'
So it doesn't find the file project.pbxproj, as it is looking at it from the wrong folder.
What I have tried so far with failed outcomes:
react-native upgrade
react-native-rename
Deleted node_modules and run npm install again
Renamed app name to correct in index.ios.js for AppRegistry.registerComponent
Where does react-native link look for the file project.pbxproj? If I find that location, I could rewrite it to the new correct one. I have no xcode, and currently only android version. I (still) have the separate index files for both versions, even I heard that after some react-native upgrade they should have been merged...
Was able to solve this by deleting the other project folders in the ios -folder. Apparently react-native just loops through every project there it finds, and picks the first one.
I stumbled this problem just today. Here are the steps I made to make it work again
Delete the ios folder
react-native eject // this will re generate the ios folder
react-native-link
I also did gradle clean before the earlier steps but I think its unnecessary.