framework version upgrade causing problem to my project - react-native

I was building a react native project and got an upgrade message when I run "yarn run ios":
simctl[5640:1381079] CoreSimulator detected version change. Framework version (857.14) does not match existing job version (857.13). Attempting to remove the stale service in order to add the expected version. error Could not get the simulator list from Xcode. Please open Xcode and try running project directly from there to resolve the remaining issues. SyntaxError: Unexpected token I in JSON at position 0、
However, after this upgrade, there is something wrong with my project. Any suggestion how to back to the old version?
I tried to use other version of ios simulator and tried to clean the xcode build, but its not help.

I ran into a similar issue. The trick was
Quit all iOS simulators
Let Xcode install the newest iOS simulators
Run the project from the Xcode workspace.
After that I was able to start the simulator again from npx react-native run-ios --simulator='iPhone 14' or yarn run iOS

Related

React-native app with expokit crash on android release build

Application is created with expo and detached to expokit. I'm using expoKit version 27.
It crashes only on first install, after refreshing app works as expected.
https://i.stack.imgur.com/SUbRQ.png
It's probably a late answer, but the correct workaround is here such that you have to run the Javascript packager first with the command expo start, after that you can start building with Android Studio.

React Native IOS Build CFBundleIdentifier Does not Exist

I have create sample React Native project and following the tutorial as per react native website.
I have try to run the application IOS simulator, its throwing error as below ,
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution Install\ Third\ Party /Users/Test/Documents/REACTJS/SampleReactNative/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/SampleReactNative.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.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/SampleReactNative.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
my environment setup information,
node version v9.8.0 npm version 5.6.0 react-native-cli: 2.0.1
react-native: 0.54.2 xcode 9.2
Please help us to resolve the issues.
I have the same problem right after init:
react-native init myapp
cd myapp
react-native run-ios
..although run-android was fine.
Not a solution but a workaround for the moment, maybe be to init using a lower version of RN:
react-native init myapp --version react-native#0.51.0
That builds okay.
Similar in an existing project, install an older version of RN.
Other versions before 0.54.2 might work but I haven't tried.
(edited 2018/4/2)
Found my solution from this link: https://github.com/facebook/react-native/issues/18238
RN 0.54 requires types available since iOS 11. So you have to upgrade your xcode and set minimum iOS version in your app to 11
In short, upgraded OSX & Xcode to the latest. (As of today, OSX 10.13.4 Xcode & 9.3)
This may happen because of some library files not found.You need to follow some steps That I have done and it is worked perfectly for me.
1.) go to Xcode project -> Target -> select build Phase -> Go to target dependies -> Click on + -> add "react" and press add.
2.) Xcode > Product -> scheme > manage sceme -> click on + button -> targetName(React) -> Okay -> make shared of this by select checkbox under shared column.
3.) Clean your project and try to build, If it is getting some error like "glog/logging.h file not found" or "cofig.h file not found" in Xcode and "CFBundleIdentifier not exist" then do not worry. You are just one step far. This is may occurs if you are missing config.h file, For this you need to update config.h file. For this
4.) follow below steps
a.) close your Xcode
b.) Open terminal with the project (Or you can directly left click your project and drag your folder to closed terminal, [It will automatically take the path from your that corresponding folder])
c.) write command
cd node_modules/react-native/third-party/glog-0.3.4/
d.) Run the configure scripted file by the command
./configure
e.) now close terminal and go to terminal with your project root path. now try final run your iOS project by
react-native run-ios
For XCODE 10.0,
I did two things
1) check out this answer
which basically says
Go to File -> Project settings
Click the Advanced button
Select "Custom" and select "Relative to Workspace" in the pull down
Change "Build/Products" to "build/Build/Products"
2) If (1) doesn't work for you then open your project from xcode
go to project navigator and select your project name --> go to info --> use debug for command-lines builds.
do this
3) go to terminal and react-native run-ios
Run the command:
react-native upgrade
react-native run-ios
or:
react-native run-android
Try to add CFBundleIdentifier in the Info.plist as:
<key>CFBundleIdentifier</key>
<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>
I experienced this issue due to the xcode 12 upgrade, and I solved my problem by upgrading my rn by using this command:
react-native upgrade
then go to podfile change your:
pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"
to:
pod 'React-callinvoker', :path => "../node_modules/react-native/ReactCommon/callinvoker"
Do you have CFBundleIdentifier in your Info.plist?
If not than add it for eg. com.ios.learning
Usually, this error comes up due to inconsistent versions (either of react-native, OS or XCode). I had the same issue with react-native v0.57.0 on MacOS Sierra and XCode v9.x.
All I had to do was to upgrade to High Sierra and then XCode to v10.0.
Otherwise, you'd have to use an older version of react-native either by downgrading it
or by initialising a project with an older version
react-native init test --version react-native#0.x.x
In my case, just delete the build directory, Pods directory, node_modules directory and running yarn install, pod install and npx react-native run-ios solves the issue.
React Native is trying to install your app on a different app name for some reason. What you can do is in Xcode --> build settings --> packaging --> change the product name to the one given in the path which the simulator is trying to install.
Look at this: https://amala-gopal.medium.com/entry-cfbundleidentifier-does-not-exist-6098b90516f6
npm uninstall react-native
delete ios and android folder
then run :
npm install react-native
react-native upgrade

Could not install the app on the device - react native on windows 10

Everytime I try to launch a react native project I got this error
Could not install the app on the device, read the error above for
details. Make sure you have an Android emulator running or a device
connected and have set up your Android development environment
I reinstalled nodejs, python and jdk using choco as suggested on official docs. Every single packages is installed as well as sdk 23.0.1
I can see my virtual device if I run adb devices USB debugging is activated and it's running android 6.
I setup ANDROID_HOME path in environment variables, I'm using same sdk path as you can see in the picture. I also setup another one for JAVA_HOME and Python.
My PATH looks like this:
I just don't understand what I'm supposed to do. I'm using a surface pro 4, Windows 10. I can run projects using expo. I literally tried everything, restart computer, start cmd using admin, create new virtual devices, uninstall everything and start from scratch, it just don't work.
You have pointed out two issues; first, make sure you have an android emulator running. To do that, you run adb devices and you say you can see you device.
The other issue is with the environment. To make sure your environment is setup properly for android, go to the root of your react-native project. Open the android project using android studio.
All errors with your environment will show up, use the automatic fixes provided by android studio. Clean the project in android studio. Close studio and go back to command line, run react-native run-android
Everything should work now.
When doing react-native start it will intentionally hang at "Loading dependency graph" (its not really hanging, its just waiting to receive build/bundle signals). This is correct. You have to open a second terminal then do react-native run-android.
If you get errors, then cd android in your project folder then run ./gradlew clean, then after that do another react-native start then react-native run-android.
Solution is to delete all java JDK and reinstall v8 / change JAVA_HOME to the new path.
Also changing gradle-wrapper.propertiesfile for each project you want to run
# update gradle to latest version
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-all.zip
Sometimes it dosen't compile with v4 so I have to use v3. React native is definitely confusing.
after install dan update environment JDK now I can install app on my device

Hello, World! program for React Native throws "Could not parse the simulator list output" on Mac

I just started learning React Native and was trying to run my Hello, World! app using the steps given in https://facebook.github.io/react-native/docs/getting-started.html#content
I took the following steps
1. `brew install watchman`
2. `npm install -g react-native-cli`
3. `react-native init hello`
4. `cd hello`
5. `react-native run-ios`
Instead of launching the iOS app, I got the following error in the terminal:
Found Xcode project hello.xcodeproj
Usage: simctl list [devices|devicetypes|runtimes]
Could not parse the simulator list output
I also tried to run it using Xcode; however Xcode shows lot of compilation errors.
Following are details on my system
OS: Mac OS v10.10.5 (Yosemite)
Node.js version: 4.4.1
Xcode version: Version 6.3 (6D554n)
Following is a screenshot of errors shown in Xcode.
Error disappeared after I launched Xcode and allowed to install some updates.
The problem was that I updated Xcode and never opened it after the update completed. After I opened Xcode it did install components then when I tried again it worked fine.
In my situation, I closed the current terminal and reopened it, then the error was gone.
I realized that I was using a beta version of Xcode. Once I installed the latest version of Xcode then all errors were gone and the app were launched in the simulator.

"babelHelpers.interopRequireDefault is not a function" when upgrading to React Native 0.16.0-rc

I upgraded to react-native 0.16.0-rc, ran npm install, then ran react-native upgrade. When trying to launch the iOS app in a simulator (or device, doesn't matter) I get the error:
[error][tid:com.facebook.React.RCTExceptionsManagerQueue] Unhandled JS Exception: babelHelpers.interopRequireDefault is not a function. (In 'babelHelpers.interopRequireDefault(_reactNative)', 'babelHelpers.interopRequireDefault' is undefined)
I've just about run out of ideas here. Is there something I need to add to my xcode project maybe? Merging the latest react-native templates into mine was a nightmare so maybe something got messed up there.
This problem is discussed in this Github issue and fixed by this commit. You can apply this patch temporarily until it is merged into the project with the version 0.16.