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

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!

Related

Cannot upgrade to expo SDK > 40 in terminal

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

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

npm install -g ios-deploy didn't work , it displays error

I am trying to install APPIUM on my machine and want to run it in actual device, for that i have to install the command 'npm install -g ios-deploy'
but when i am trying to install it is dispalying the error.
Error:
he following build commands failed:
PhaseScriptExecution Run\ Script build/ios-deploy.build/Release/ios-deploy.build/Script-C0CD3D981F59D20100F954DB.sh
(1 failure)
npm ERR! code ELIFECYCLE
npm ERR! errno 65
npm ERR! ios-deploy#1.9.2 preinstall: ./src/scripts/check_reqs.js && xcodebuild
npm ERR! Exit status 65
npm ERR!
npm ERR! Failed at the ios-deploy#1.9.2 preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/synerzip/.npm/_logs/2018-07-21T10_30_21_090Z-debug.log
syn-macmini-03:~ synerzip$ xcodebuild
xcodebuild: error: The directory /Users/synerzip does not contain an Xcode project.
Solution Tried:
sudo npm install -g ios-deploy
npm install -g ios-deploy --unsafe-perm=true
npm install -g ios-deploy --allow-root
Details:
OS: 1.13.6
xcode version: 9.4.1
node version: v10.7.0
Note
when i run the command 'xcode-select --print-path' following path display,
"/Applications/Xcode.app/Contents/Developer"
Can Any help me on this.
Thanks.
I have tried the following steps sequentially and it works for me.
sudo npm uninstall -g ios-deploy
brew install ios-deploy
#Paul - Thanks for looking in it.
I have Fixed it with following STEPS...
(Ignore steps if you have already done it)
Debug on real iOS device iONIC App
Install brew( with command on terminal ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”)
Install Xcode
Run sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
Install iOS-deploy (brew install ios-deploy)
Build iOS with ionic cordova build ios --buildFlag="-UseModernBuildSystem=0"
Go to Xcode and set provisioning profile certificate
Attach device and run command on terminal ionic cordova run ios --buildFlag="-UseModernBuildSystem=0"
First it will fail as you need to Go to setting—>General -.>Device management->Click on your development certificate->Trust.
Done now you can run your ionic app on your real iOS device directly with just ionic cordova run ios --buildFlag="-UseModernBuildSystem=0"
Cheers!!!!!!!!!
To use ios-deploy as a command-line tool it is recommended you now install it directly via Homebrew(and if you have already installed it via npm to uninstall it).
https://github.com/ios-control/ios-deploy#installation
The Homebrew and npm versions will be updated at the same time going forward.
I could fix the problem by installing the "Xcode 10 beta 4" on my computer.
Another solution is provided on GitHub - check out the following links.
https://github.com/ios-control/ios-deploy/issues/346
https://github.com/ios-control/ios-deploy/issues/349#issuecomment-405937763
After the below command
$ npm uninstall -g ios-deploy
You should restart your command line. And than you can run below line on command line.
$ brew upgrade ios-deploy

"pod init" creates error that says "You need at least git version 1.8.5 to use CocoaPods"

I was not able to install any pod in my system.
Hence, I removed cocoapods from my Mac and then reinstalled it.
The process was successful but when I run the command pod init following error shows up in the terminal:
`verify_minimum_git_version!': [!] You need at least git version 1.8.5 to use CocoaPods (Pod::Informative)
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/command.rb:49:in `run'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/bin/pod:55:in `<top (required)>'
from /usr/local/bin/pod:23:in `load'
from /usr/local/bin/pod:23:in `<main>'
I also checked my Git version which was 1.8.4 but I am getting any solution to update the same.
It needs to set your command line tool version, in your Xcode (Preferences).
You can download latest command line tool from Apple Download Portal, if you have paid apple developer account/id.
Here are current stable and beta Xcode Tools and supporting command line tool download links. (Ensure you're logged in using premium developer account on Apple Developer Account to access these links)
Xcode 11
Xcode 11.2 beta 2
- (Command Line Tool (Xcode 11.2 beta 2) - for macOS 10.14)
Xcode 11
- (Command Line Tool (Xcode 11) - for macOS 10.14)
Xcode 10
Xcode 10.2.1
- (Command Line Tool (Xcode 10.2.1) - for macOS 10.14)
Xcode 10.2
- (Command Line Tool (Xcode 10.2) - for macOS 10.14)
Xcode 10.1
- (Command Line Tool (Xcode 10.1) - for macOS 10.14)
- (Command Line Tool (Xcode 10.1) - for macOS 10.13)
Xcode 10
- (Command Line Tool (Xcode 10) - for macOS 10.14)
- (Command Line Tool (Xcode 10) - for macOS 10.13)
Once you've latest command line tool installed in your system, set it from Xcode Menu.
(Xcode Menu Items) Xcode ► Preferences ► Location ► Command Line Tool ► Select appropriate command line tool
Firstly remove the existing git in your system using commands:-
Use command "which git"
that will give u the path say "/usr/local/bin/git", then use command->$ sudo rm -rf /usr/local/bin/git
This will remove existing git from your system
Then reinstall git again
$ brew install git
It might issue a warning saying
Warning: git 2.13.2 is already installed, it's just not linked.
You can use `brew link git` to link this version.
Then run below mentioned command:-
$ sudo chown -R $(whoami) /usr/local/share/
$ sudo chown -R $(whoami) /usr/local/lib
$ brew link --overwrite --dry-run git
It might give you error
Error: Could not symlink share/git-core/templates/description
Target /usr/local/share/git-core/templates/description
already exists. You may want to remove it:
rm '/usr/local/share/git-core/templates/description'
To force the link and overwrite all conflicting files:
brew link --overwrite git
To list all files that would be deleted:
brew link --overwrite --dry-run git
Then finally run command
$ brew link --overwrite git
This is how I updated my git and pod init worked. Hope you find it helpful :)
I had a similar issue after installing a second Xcode.
As a result there was no command line tools specified in xcode-select -p
Fixed by manually choosing newer Xcode version
I came across this answer after installing latest version of XCode 9.3 -
I was trying to do a -
Pod Update [ or --version, or any pod command ...]
I tried to "brew install git" like in the top answer but there was all kinds of complaints about no access to Cellar, then when I added access, missing c compilers ..
The command line tools setting in Locations in Xcode Preferences showed command latest 9.3 line tools installed "correctly", but after reading the above answers I decided to install it again using -
xcode-select --install
After the download / install, pod started working again, was still having issues with brew which was a high sierra issue. fixed with -
https://github.com/Homebrew/brew/issues/3285.
Run the command
$ brew install git
Then navigate to your project folder and type pod init
These steps worked for me

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.

Resources