expo error installing or running app - react-native

when I try to run my app on the iOS simulator I get the error :
Error running xcrun simctl openurl booted exp://localhost:19000: An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=60):
The operation couldn’t be completed. Operation timed out
Operation timed out
Error installing or running app. Error: Process exited with non-zero code: 60
any idea how to solve this error ?

This usually is an error with the Simulator. If you remove expo (delete the app) from the simulator and run the command again, it should build fine.
However, if it still fails, Erasing all content and settings on the simulator does the trick too.

FOUNT IT!
you must have a .watchmanconfig file (like below)
File example
When you initialize a project with expo init "projectname", there is no .watchmanconfig file.
So, create one and in this file, just initialize an empty object like this : {}
Then you can start with expo start or yarn/npm start
It solved all my problem.
Hope it does for you too.

For anyone like me also searching this issue, it is possible to un-eject your app and run again like normal. From the docs, Delete the ios and android directories from your project. Delete the isDetached and detach keys from your project's app.json. You can now use your project like a normal Expo project (with no ExpoKit). Read more at https://docs.expo.io/versions/latest/expokit/advanced-expokit-topics/

It may be an issue with some outdated simulators in your simulator cache. On MacOS remove the sub-directories in the following directory:
~/Library/Developer/CoreSimulator/Caches/

check if you have .watchmanconfig file present in root, if not create one .watchmanconfig and initialize empty object and run command npm start again

Related

Expo SplashScreen Standalone Build Failed

I am trying to build my application at Expo but I have the following problem:
Error Expo
When looking at the build error log, I have the following message:
Using manifest: {"ios":{"supportsTablet":true,"userInterfaceStyle":"light"},"web":{"favicon":"./assets/favicon.png"},"icon":"./assets/icon.png","name":"Porta do Sol","slug":"portaDoSol","splash":{"image":"./assets/splash.png","imageUrl":"https://d1wp6m56sqw74a.cloudfront.net/~assets/761e4c800ce1de9fd90da12f45687087","resizeMode":"contain","backgroundColor":"#ffffff"},"android":{"package":"com.interface.portadosol","userInterfaceStyle":"light"},"iconUrl":"https://d1wp6m56sqw74a.cloudfront.net/~assets/5aab62d1ae6a0f65e10f12c0e55d20dd","locales":{},"updates":{"fallbackToCacheTimeout":0},"version":"0.0.1","platforms":["ios","android","web"],"entryPoint":"./index.js","sdkVersion":"38.0.0","orientation":"portrait","dependencies":["#react-native-community/masked-view","#react-navigation/drawer","#react-navigation/native","#react-navigation/stack","expo","expo-splash-screen","expo-sqlite","expo-status-bar","expo-updates","native-base","react","react-dom","react-native","react-native-appearance","react-native-gesture-handler","react-native-reanimated","react-native-safe-area-context","react-native-screens","react-native-svg","react-native-svg-charts","react-native-web","sqlite"],"bundledAssets":["asset_3a2ba31570920eeb9b1d217cabe58315.ttf","asset_8b12b3e16d591abc926165fa8f760e3b.json","asset_744ce60078c17d86006dd0edabcd59a7.ttf","asset_461d9bba8b6a3c91675039df12cfe6ca.json","asset_140c53a7643ea949007aa9a282153849.ttf","asset_94c4ffdcbffeb0570c635d7f8edd8a25.json","asset_ca9ce9ff0676a9b04ef0f8a3ad17dd08.ttf","asset_54a5c98d22f313098b3dbe2d5b2e87ba.json","asset_b49ae8ab2dbccb02c4d11caaacf09eab.ttf","asset_39843e5d52a6c5c42d5abdb0b34bcaa6.json","asset_b06871f281fee6b241d60582ae9369b9.ttf","asset_f1f91feb805137c9283fb766620ec5eb.json","asset_09dd345dbd4ec5a0874841d5749ac153.json","asset_0886a6b127c6057cee83f9c65c7ffd62.json","asset_f6c6f6c8cb7784254ad00056f6fbd74e.ttf","asset_b70cea0339374107969eb53e5b1f603f.ttf","asset_c39278f7abfc798a241551194f55e29f.ttf","asset_e20945d7c929279ef7a6f1db184a4470.ttf","asset_60668d999bbaf663420340f7bdd580d7.json","asset_b2e0fc821c6886fb3940f85a3320003e.ttf","asset_3e6805fbc794680014716b8c752f20b8.json","asset_3c851d60ad5ef3f2fe43ebd263490d78.ttf","asset_1a0e3525dd5df87e77057204129a5e6e.json","asset_a37b0c01c0baf1888ca812cc0508f6e2.ttf","asset_7e078700f0c35367a56c5bbb2047dda7.json","asset_8e7f807ef943bff1f6d3c2c6e0f3769e.ttf","asset_fdc01171a7a7ea76b187afcd162dee7d.json","asset_d2285965fe34b05465047401b8595dd0.ttf","asset_647543ebfccf6e5495434383598453d1.json","asset_5cdf883b18a5651a29a4d1ef276d2457.ttf","asset_74d124a3caeac2bea111f3ca2f2dd34a.json","asset_7d40544b395c5949f4646f5e150fe020.png","asset_cdd04e13d4ec83ff0cd13ec8dabdc341.png","asset_a132ecc4ba5c1517ff83c0fb321bc7fc.png","asset_0ea69b5077e7c4696db85dbcba75b0e1.png","asset_f5b790e2ac193b3d41015edb3551f9b8.png","asset_5223c8d9b0d08b82a5670fb5f71faf78.png","asset_fd0192cf977ddf7b60b4e21e332f6b76.json","asset_15e61754d2d3825004eed075f496ae28.png","asset_778ffc9fe8773a878e9c30a6304784de.png","asset_376d6a4c7f622917c39feb23671ef71d.png","asset_c79c3606a1cf168006ad3979763c7e0c.png","asset_02bc1fa7c0313217bde2d65ccbff40c9.png","asset_35ba0eaec5a4f5ed12ca16fabeae451d.png"],"id":"#matheusms21/portaDoSol","releaseId":"c05eb142-056f-40e6-a330-79bd258d0e14","revisionId":"0.0.1-r.OkgIqpx_B","publishedTime":"2020-10-04T03:29:57.730Z","commitTime":"2020-10-04T03:29:57.793Z","bundleUrl":"https://d1wp6m56sqw74a.cloudfront.net/%40matheusms21%2FportaDoSol%2F0.0.1%2Fecb187f580b4c9bbd9873239fc05375e-38.0.0-android.js","releaseChannel":"default","hostUri":"exp.host/#matheusms21/portaDoSol"}
Error: ENOENT: no such file or directory, open '/app/turtle/workingdir/android/sdk38/android-shell-app/app/src/main/res/drawable/splashscreen.xml'
The strange thing is that yesterday I managed to finish the build, but today I have this error, and I did not make any changes to SplashScreen or anything like that.
Thanks to anyone who can help me.
Now the build finished without the error.
It was probably their mistake that was corrected at this point.
Thank you all :)

React native link fails with no package found

I'm not sure what exactly is happening but I am unable to run react-native link without errors occuring
CLI Output:
react-native link --verbose
debug Available platforms: iOS, Android
debug Targeted platforms: iOS, Android
debug Getting project config for iOS...
debug Getting project config for Android...
error No package found. Are you sure this is a React Native project?
error Unexpected close tag
Line: 22
Column: 24
Char: >
debug Error: Unexpected close tag
Line: 22
Column: 24
Char: >
at error (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/xmldoc/node_modules/sax/lib/sax.js:666:10)
at strictFail (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/xmldoc/node_modules/sax/lib/sax.js:692:7)
at closeTag (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/xmldoc/node_modules/sax/lib/sax.js:885:9)
at SAXParser.write (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/xmldoc/node_modules/sax/lib/sax.js:1447:13)
at new XmlDocument (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/xmldoc/lib/xmldoc.js:199:15)
at readManifest (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/#react-native-community/cli/build/tools/android/readManifest.js:44:10)
at Object.projectConfig (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/#react-native-community/cli/build/tools/android/index.js:66:46)
at Object.keys.forEach.platform (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/#react-native-community/cli/build/commands/link/getProjectConfig.js:25:62)
at Array.forEach (<anonymous>)
at getProjectConfig (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/#react-native-community/cli/build/commands/link/getProjectConfig.js:22:35)
This randomly started happening after attempting to npm install react-native-firebase.
What I've tried
clear-caches
remove node_modules and npm install
Checking out my code back to a previous commit
Adding my package name to the manifest locaed in /android/app/src/debug/AndroidManifest.xml
Removing the app from my computer and cloning it from github
Running react-native link on another project, which works, but i just can't run react-native link on this specific project.
So the answer to my question was that in my android manifest xml file, there was an incorrect closing brace for one of my intent filters.
So for anyone that this happens to ensure that all of your Android files have correct syntax.
I fixed this problem by closing some unclosed tag in android/app/src/main/androidManifest.xml. Try checking the file line by line.

React - native developement server return response error code : 500

I'm building an application in react-native, everything was working fine .After npm install, react-native doesn't detect some of my files anymore saying it doesnt exist, doesn't seem to detect any changes either. I get
"Developpement server returned response error 500, unable to resolve module `../services/myFile` none of these files exist." on android and on IOS 'Failed to load Bundle with error: "unable to resolve module ./screens/anotherFile"
When I remove those files (from the files they are use in) the error is still the same. Any ideas ?
Like #firu said, make sure you do a react-native-link, this happens if you have deleted the ios or android folder. Most cases when you are upgrading react-native with react-native-upgrade

React Native Android fails: error 3

Hope you could help me here:
I'm currently building an app which I created through CRNA and then ejected. I get the ios version right on but I'm currently struggling a lot with the android version.
When running react-native run-android all I can get is the following error:
Error type 3
Error: Activity class {com.myapp/com.myapp.MainActivity} does not exist.
I've checked app/build.gradle, app/src/main/AndroidManifest.xml, app/src/main/java/com/myapp/MainActivity.java and app/src/main/java/com/myapp/MainActivity.java for name errors on package. I've tried moving from com.myapp to com.mebius.myapp and com aswell.
Seems this comes from the only plugin I'm using. I'm keeping on the investigation
Any hints?
There are 3 possible reasons for the android app build fails to make
1. You need to define sdk path in android/local.properties
if local.properties doesn't place then make a file names with that
add
sdk.dir = home/user/AndroidApp/local/Sdk
You can match with their system path..
2. Your genymotion or avd must enable with the android studio
3. You must have to go with the following command
npm start
in new terminal .
Please go through with it.
Thanks
Actually I had a problem with my gradle config which look like:
include ':react-native-sensors'
project(':react-native-sensors').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-sensors/android')
rootProject.name = 'accelapp'
I needed to add: include ':app'
I don't know if it's due to the process of ejecting from CRNA or if it's due to react-native link react-native-sensors though.
EDIT After some investigation, I couldn't reproduce this issue. This leads me to say it was a faulty copy/paste...

An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2)

I'm getting such error, while building IOS app in React Native project:
was encountered processing the command (domain=NSPOSIXErrorDomain,
code=2) Print: Entry, ":CFBundleIdentifier", Does Not Exist
I read threads in GitHub regarding that issues, however didn't find solutions there which could solve my problem. Any ideas how to fix it?
The cause might be that you have some build files from the previous build which are causing the problem.
Clear the ios/build/your_project to trigger a fresh build
In my case the Xcode build folder needed to be cleaned. To fix, in Xcode go to Product | Clean Build Folder
In my case, the cause was - The build file name was MyMob.app but the app it tries to install to the simulator was mymob.app.
I solved it by changing the line in mymob.xcscheme:46
BuildableName = "MyMob.app"
BuildableName = "mymob.app"
Log was
iinfo Installing "build/mymob/Build/Products/Debug-iphonesimulator/mymob.app"
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
info Launching "com.mymob.app"
error Failed to launch the app on simulator, An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=4):
The request to open "com.mymob.app" failed.
Underlying error (domain=FBSOpenApplicationErrorDomain, code=4):
The operation couldn't be completed. Application info provider (FBSApplicationLibrary) returned nil for "com.mymob.app"
Application info provider (FBSApplicationLibrary) returned nil for "com.mymob.app"