Cannot upgrade to expo SDK > 40 in terminal - ios

So I am trying to submit a react native app with the eas/expo commands in the prompt. I have deleted and re-installed node, npm, eas, and expo many times, yet when I am doing the "eas build" command it still says I should have expo SDK > 40 for it to work.
when I do the "node --version" command it says v16.15.1
it says "eas-cli/0.53.1 darwin-x64 node-v16.15.1" for eas version
5.4.9 for expo version
8.11.0 for npm version
I have been running these commands to update them:
"npm install -g npm#latest
npm install --global expo-cli#44 (I tried many version)
sudo npm i -g expo-cli
n stable
n latest. "
Any guidance is greatly appreciated on how to get my current version to > 40.
Best Regards,
Evan

This refers to the Expo SDK version in package.json files as below
//...other packages...
"color": "4.0.1",
"expo": "^43.0.0", <= Expo SDK version
"expo-av": "~10.1.3",
Check the app Expo SDK version, if lower than 40, you need to upgrade it to your preferred version.
Upgrade instruction - https://docs.expo.dev/workflow/upgrading-expo-sdk-walkthrough

Related

react-native run-ios Build Fail: CompileC RCTBaseTextInputView.o

How to fix this build failure in ios?
I'm using Xcode Version 9.2
Mac OS Sierra
What is RCTBaseTextInputView?
CompileC
/Users/bliss/Library/Developer/Xcode/DerivedData/RNJyotish-fjjxyvwbhqivjwbnwwqhmqzgfazq/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTText.build/Objects-normal/x86_64/RCTBaseTextInputView.o
/Users/bliss/Documents/Coder/ReactNative/RNCLI/BITBUCKET/rnjyotish/node_modules/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.m
normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
Each and Every version really matters. This may be done other way for another version. But for Mac High Sierra follow this:
My System:
High Sierra 10.13.3
XCode 9.4
Node 8.11.1
react-native-cli#2.0.1
watchman 4.9.0
react-native#57.8
android studio 3.6.3
Android Emulator: Pixel API 28 : Android Pie 9
Also Tested: Genymotion 3.1.0 : Samsung Galaxy S10 Android 10
Iphone Emulator 11.3
Xcode Build location Unique: xcode -> Preference->Locations -> Advanced
[If you do not installed nvm then uninstall node completely then install it through nvm. It is not required but highly recommended]
nvm install 8.11.1
THIS VERSION DOES NOT REQUIRE yarn. So I deleted yarn cause later version was making trouble for yarn,
You may try with yarn if it is already installed but for this build not required
brew uninstall yarn
brew install watchman
do not use npx rather you are going toward particular version
npm install -g react-native-cli#2.0.1
add react-native to .bash_profile:
export PATH="/Users/hasan/.nvm/versions/node/v8.11.1/bin/:$PATH"
*if you have used oracle java over version 8, uninstall that with the following:
sudo rm -rf /Library/Java/JavaVirtualMachines/jdk-11.jdk
Install openJDK8:
brew tap AdoptOpenJDK/openjdk
brew cask install adoptopenjdk8
ALWAYS USE VERSION NUMBER. REACT NATIVE DOESN'T FIX ANYTHING MAGICALLY
react-native init RealmProject --version 0.57.8
Install android sdk:
http://reactnative.dev/docs/0.57/getting-started
Add the following to .bash_profile:
export ANDROID_HOME=/Users/hasan/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
After above complete successfully:
react-native run-android
react-native run-ios
if you had any error MAKE SURE you delete all caches:
watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache
up to this point there will be no problem but to make it more protected:
Change gradle-wrapper.properties 4.4 to 4.9 under Project>android>gradle>wrapper>gradle-wraper.properties:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip
android>build.gradle plugin version change to 3.2.1
classpath 'com.android.tools.build:gradle:3.2.1'
Cheers and Happy Coding!

React-Native Bundle Error error SHA-1 for file is not computed

I am facing this error while creating bundle of react-native app.
I am executing command react-native bundle --dev false --entry-file index.js --bundle-output ios/main.jsbundle --platform ios
error SHA-1 for file /usr/local/lib/node_modules/react-native/node_modules/metro/src/lib/polyfills/require.js (/usr/local/lib/node_modules/react-native/node_modules/metro/src/lib/polyfills/require.js) is not computed. Run CLI with --verbose flag for more details.
ReferenceError: SHA-1 for file /usr/local/lib/node_modules/react-native/node_modules/metro/src/lib/polyfills/require.js (/usr/local/lib/node_modules/react-native/node_modules/metro/src/lib/polyfills/require.js) is not computed
at DependencyGraph.getSha1 (/usr/local/lib/node_modules/react-native/node_modules/metro/src/node-haste/DependencyGraph.js:258:13)
at /usr/local/lib/node_modules/react-native/node_modules/metro/src/DeltaBundler/Transformer.js:211:26
at Generator.next (<anonymous>)
at asyncGeneratorStep (/usr/local/lib/node_modules/react-native/node_modules/metro/src/DeltaBundler/Transformer.js:46:24)
at _next (/usr/local/lib/node_modules/react-native/node_modules/metro/src/DeltaBundler/Transformer.js:66:9)
at /usr/local/lib/node_modules/react-native/node_modules/metro/src/DeltaBundler/Transformer.js:71:7
at new Promise (<anonymous>)
at /usr/local/lib/node_modules/react-native/node_modules/metro/src/DeltaBundler/Transformer.js:63:12
at Transformer.transformFile (/usr/local/lib/node_modules/react-native/node_modules/metro/src/DeltaBundler/Transformer.js:236:7)
at /usr/local/lib/node_modules/react-native/node_modules/metro/src/Bundler.js:87:34
react-native info command output
info Fetching system and libraries information...
System:
OS: macOS Mojave 10.14.3
CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU # 2.30GHz
Memory: 1.73 GB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.16.0 - /usr/local/bin/node
Yarn: 1.19.1 - /usr/local/bin/yarn
npm: 6.13.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
Android SDK:
API Levels: 23, 25, 26, 27, 28, 29
Build Tools: 27.0.3, 28.0.3
System Images: android-29 | Google Play Intel x86 Atom
Android NDK: 20.1.5948944
IDEs:
Android Studio: 3.4 AI-183.6156.11.34.5522156
Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.5 => 0.61.5
npmGlobalPackages:
create-react-native-app: 2.0.2
react-native-cli: 2.0.1
react-native: 0.61.5
To solve my issue I have run command with --force option.
npm install -i -g --force react-native-cli
This issue was raise due to configure old project with old react-native version. and then trying to run latest react-native ver with new Project.
install with npx
run
on windows 10
npx react-native run-android
on linux
npx react-native start
I resolved the issue in my Mac using
npx react-native start
For me, I installed the wrong package.
Instead of this:
npm i -g react-native
Make sure you do this:
npm i -g react-native-cli
I can't comment so use npm install -i -g --force react-native-cli as stated by Punita. It works when it comes to fixing the SHA-1 issue.
But please don't use sudo for any npm related things. thanks.
I think that's about version of react-native-cli.
You should try to update.
npm i -g react-native-cli
To solve my issue I have run command with --force option.
npm install -i -g --force react-native-cli
I would like to add that this same error happened to me (running on PC, Windows) when I tried to run the gradle command to build an Android release (./gradlew bundleRelease).
I found the cause of the issue was due to using Dropbox to sync the folder that this React Native project belonged to, using the Dropbox "Back up your PC automatically" feature, where I had my user Documents folder backed up by Dropbox. Essentially, I would get an error like this:
error SHA-1 for file C:\Users\Ted
Zhu\Documents\my-app\MyAppWin\index.js (C:\Users\Ted
Zhu\Dropbox\PC\Documents\my-app\MyAppWin\index.js)
is not computed. Run CLI with --verbose flag for more details.
ReferenceError: SHA-1 for file C:\Users\Ted
Zhu\Documents\my-app\MyAppWin\index.js (C:\Users\Ted
Zhu\Dropbox\PC\Documents\my-app\MyAppWin\index.js)
is not computed
I would notice in the error message, it referred to the same file (index.js) with two different paths:
C:\Users\Ted Zhu\Documents\my-app\MyAppWin\index.js
C:\Users\Ted
Zhu\Dropbox\PC\Documents\my-app\MyAppWin\index.js
This must've been because Dropbox created a symbolic link of the folder so that it would have a path within my Dropbox folder. This appears to cause the file in question to have two paths that refer to the same folder, and trick the Metro bundler into thinking that a SHA hash was not created for one of the project files.
The solution was to move this project to a different directory that is not backed up by Dropbox. In my case, I just created a new folder in my user home directory. Then I was able to successfully run the gradle command to build the Android app.
For me, I fixed it by install correct react-native-cli:
yarn global remove react-native-cli
yarn global add react-native-cli
For me, global cli update does not work.
I Just run the command like yarn react-native bundle...It works!
yarn react-native bundle --reset-cache --entry-file index.js --platform ios --bundle-output test.bundle --dev false
This worked for me:
npx react-native start
When Metro has started, open another Tab on the terminal, same directory then run:
npx react-native bundle ...
The problem for me was not using npx for the react-native command.
To solve I have run
npm install -i -g --force react-native-cli

Electron app do not start but electron-builder (dist) is ok

Can't figure what's wrong in my electron project. Starting with electron . will fail with one native module (pkcs11js). See image :
But running npm run dist will build installer just fine, and running this installer work's fine and app is starting/workin like charm !
PS C:\Users\esa\devel\netauth\client> npm run dist
> Yubiconn2#1.0.0 dist C:\Users\esa\devel\netauth\client
> electron-builder -w --x64
• electron-builder version=21.2.0 os=10.0.18362
• loaded configuration file=package.json ("build" field)
• writing effective config file=dist\builder-effective-config.yaml
• rebuilding native dependencies dependencies=pkcs11js#1.0.18 platform=win32 arch=x64
• packaging platform=win32 arch=x64 electron=6.0.7 appOutDir=dist\win-unpacked
• building target=nsis file=dist\Yubiconn2 Setup 1.0.0.exe archs=x64 oneClick=true perMachine=false
• building block map blockMapFile=dist\Yubiconn2 Setup 1.0.0.exe.blockmap
and this was fine before today when I upgraded all outdated npm packages up-to-date. And nodejs too. This is Win10 env. My OsX env will work without any problem.
I have tried :
rm -rf node_modules; npm install
npm rebuild
even installing electron-rebuild and running .\node_modules\.bin\electron-rebuild
I understand electron-builder will rebuild all native dependencies for distribution. How to make same with development env (electron . or npm start)
I think you need to update node.js. See the part of your error about NODE_MODULE_VERSION
This explains the value of NODE_MODULE_VERSION https://nodejs.org/en/download/releases/#ref-1

IONIC:Unable to install phonegap-plugin-push in ios app

I am new with ionic framework.Currently i am working on ionic iOS app. when i install phonegap-plugin-push i am getting error
Failed to install 'phonegap-plugin-push':undefined Error: /Library/Ruby/Gems/2.0.0/gems/claide-1.0.1/lib/claide/command.rb:439:in `help!': [!] You cannot run CocoaPods as root. (CLAide::Help)
i have searched it but no solution found yet!
I also got same kind of problem. In my case I used sudo ionic platform add ios
This is worked well while building every plugins but phonegap-plugin-push.
phonegap-plugin-push is keep giving above error [!] You cannot run CocoaPods as root. (CLAide::Help)
Then I used ionic platform add ios without sudo This is the actual solution for this. But in this case It is keep giving me the permission related issue code EACCESS.
Then I used followings step to overcome that one.
sudo chown -R $USER /usr/local/
Again added cordoava and ionic
sudo npm install -g cordova
sudo npm install -g ionic
Other informations
phonegap-plugin-push version: 1.10.0
Cordova CLI: 6.5.0
Ionic CLI Version: 2.2.2
Node Version: v7.7.2
Xocde Version: Xcode 8.2.1
CocoaPods Version: 1.2.0
Hope this will help.

React-native#0.26.3 requires a peer of react#15.0.2 but none was installed

I am trying to set up for the react native. but whenever I update files it gives m error
enoent ENOENT: no such file or directory, open 'React Native/package.json'
npm WARN react-native#0.26.3 requires a peer of react#15.0.2 but none was installed.
npm WARN React Native No description
npm WARN React Native No repository field.
npm WARN React Native No README data
npm WARN React Native No license field.
MacBook-Pro:React Native$ npm info react dist-tags.latest
Please let me know how can I fix.
Installing react should fix the error
npm install react --save
Also, you may try upgrading your react-native install. react-native is as v0.30.0 now
npm update react-native
In my specific case I was running npm install in the wrong directory. I thought I was in my project directory but was one level higher. This meant react was missing from installed packages (because there were none) and thus gave this error.
Some steps that worked for me:
1. watchman watch-del-all
2. rm -rf node_modules
3. npm install react#15.0.2 --save
4. npm install react#15.1.0 --save
5. npm install
6. rm -fr $TMPDIR/react-*
7. npm start -- --reset-cache
In my case, the project I am working on requires a specific version of React. Since it was older than the current release, doing an install/update would still cause the error.
In order to fix the problem, I had to check the package.json of the project and install the exact version allowed by the dependency definition. In the OP's case, a
npm install react#15.0.2
should fix the problem by installing the exact version of the React module that react-native requires.
Verify that the condition was resolved by doing a npm list to see if there are any other unmet peer dependencies.

Resources