I am setting up IOS dev for React Native (0.61) app which has the working android version. What I did was to copy src of components and package.json file after react native environment is setup by following online post (installed xcode command line tool 10.2). But launching run-ios failed:
$ react-native run-ios
error Could not find "Podfile.lock" at /Users/mine/Documents/code/js/emps_fe6/ios/Podfile.lock. Did you run "pod install" in iOS directory?
error Could not find the following native modules: RNCAsyncStorage, RNDeviceInfo, RNGestureHandler, RNKeychain, BVLinearGradient, RNLocalize, RNReanimated, RNVectorIcons, react-native-video. Did you forget to run "pod install" ?
info Found Xcode project "emps_fe6.xcodeproj"
xcrun: error: unable to find utility "simctl", not a developer tool or in PATH
error Could not parse the simulator list output. Run CLI with --verbose flag for more details.
Error: Command failed: xcrun simctl list --json devices
xcrun: error: unable to find utility "simctl", not a developer tool or in PATH
at checkExecSyncError (child_process.js:629:11)
at Object.execFileSync (child_process.js:647:13)
at runOnSimulator (/Usersamine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli-platform-ios/build/commands/runIOS/index.js:130:54)
at Object.runIOS [as func] (/Users/mine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli-platform-ios/build/commands/runIOS/index.js:100:12)
at Command.handleAction (/Users/mine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli/build/index.js:164:23)
at Command.listener (/Users/mine/Documents/code/js/emps_fe6/node_modules/commander/index.js:315:8)
at Command.emit (events.js:198:13)
at Command.parseArgs (/Users/amine/Documents/code/js/emps_fe6/node_modules/commander/index.js:651:12)
at Command.parse (/Users/mine/Documents/code/js/emps_fe6/node_modules/commander/index.js:474:21)
at setupAndRun (/Users/mine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli/build/index.js:237:24)
Here is the output of react native info:
$ react-native info
info Fetching system and libraries information...
System:
OS: macOS High Sierra 10.13.6
CPU: (8) x64 Intel(R) Core(TM) i7-2675QM CPU # 2.20GHz
Memory: 194.93 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.17.0 - /usr/local/bin/node
Yarn: 1.19.1 - /usr/local/bin/yarn
npm: 6.11.3 - /usr/local/bin/npm
IDEs:
Xcode: /undefined - /usr/bin/xcodebuild
npmPackages:
react: 16.11.0 => 16.11.0
react-native: 0.61.2 => 0.61.2
npmGlobalPackages:
react-native-cli: 2.0.1
Here is the package.json:
"dependencies": {
"#react-native-community/async-storage": "^1.6.2",
"moment": "^2.24.0",
"react": "16.11.0",
"react-native": "0.61.2",
"react-native-cli": "^2.0.1",
"react-native-confirmation-code-field": "^4.1.0",
"react-native-device-info": "^4.0.1",
"react-native-elements": "^1.2.6",
"react-native-gesture-handler": "^1.4.1",
"react-native-gifted-chat": "^0.11.3",
"react-native-keychain": "^4.0.1",
"react-native-linear-gradient": "^2.5.6",
"react-native-localize": "^1.3.1",
"react-native-modal": "^11.4.0",
"react-native-modal-datetime-picker": "^7.6.0",
"react-native-reanimated": "^1.3.0",
"react-native-segmented-control-tab": "^3.4.1",
"react-native-vector-icons": "^6.6.0",
"react-native-video": "^5.0.2",
"react-navigation": "^4.0.10",
"react-navigation-stack": "^1.10.2",
"react-navigation-tabs": "^2.5.6",
"simctl": "^2.0.0",
"socket.io-client": "2.1.1",
"xcode": "^2.0.0"
},
In the error message, there mentioned quite a few modules which are missing. But those modules have been installed as it shows in the package.json. I am not sure about what the error message means. Also I installed the simctl but scrum simctl still can not find it. I am using VS Code as IDE.
UPDATE:
created an empty Podfile.lock under /ios, the error becomes when run-ios:
error Cannot read property 'SPEC CHECKSUMS' of undefined. Run CLI with --verbose flag for more details.
TypeError: Cannot read property 'SPEC CHECKSUMS' of undefined
at getDependenciesFromPodfileLock (/Users/mine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli-platform-ios/build/link-pods/getDependenciesFromPodfileLock.js:63:58)
at warnAboutPodInstall (/Users/mine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli-platform-ios/build/link/warnAboutPodInstall.js:43:67)
at Object.runIOS [as func] (/Users/mine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli-platform-ios/build/commands/runIOS/index.js:80:36)
at Command.handleAction (/Users/mine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli/build/index.js:164:23)
at Command.listener (/Users/mine/Documents/code/js/emps_fe6/node_modules/commander/index.js:315:8)
at Command.emit (events.js:198:13)
at Command.parseArgs (/Users/mine/Documents/code/js/emps_fe6/node_modules/commander/index.js:651:12)
at Command.parse (/Users/mine/Documents/code/js/emps_fe6/node_modules/commander/index.js:474:21)
at setupAndRun (/Users/mine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli/build/index.js:237:24)
at Object.run (/Users/mine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli/build/index.js:184:11)
First install the cocoapods
sudo gem install cocoapods
Then run the below command on root folder
cd ios && pod install && cd ../ && react-native run-ios
Step 1:
sudo gem install cocoapods
Step 2:
cd ios && pod install && cd ../ && react-native run-ios
If you still get error while installing pods continue the below steps.
Step 3: Put this in console ->
xcrun -k --sdk iphoneos --show-sdk-path
if the answer is
xcrun:_ error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: unable to lookup item 'Path' in SDK 'iphoneos'
then put this:
sudo xcode-select --switch /Applications/Xcode.app
Then install pod again
I had the same issue and I solve the problem using bellow approach.
Navigate to iOS folder and then run bellow command:
pod update
pod update command will update all dependency and generate a "Podfile.lock" file.
I had a similar issue and resolved it by jumping into the ios folder and running:
pod update
Doing this directly in the ios folder resulted in the generation of Podsfile.lock
Changing out of ios into the main directory I was able to then launch the app on an IOS simulator using:
npx react-native run-ios
I have tried many solutions. But finally tried something logical. I don't know why i didn't tried first :)
pod install doesn't work.It changes nothing. The problem is "Podfile" is there but not "Podfile.lock". Thats the problem. When we try install again, it is doing nothing because Podfile is there.
Solution is removing "Podfile" then pod install again. Then you will see both files "Podfile" and "Podfile.lock". After many hours of struggling, this was the solution for me and i have tried many thing :) Good luck to you all.
For anybody with Mac M1 that nothing worked and still having the problem.
They actually say at the docs you need to run those commands
sudo arch -x86_64 gem install ffi
arch -x86_64 pod install
when it ends will tell
[!] Please close any current Xcode sessions and use `MyApp.xcworkspace` for this project from now on.
Pod installation complete! There are 55 dependencies from the Podfile and 46 total pods installed.
if you go and now run pod install you will notice the deference
This solution would work when you are trying to START a project, I don't know if it would help while you are in one and come across this issue.
Here is what I did:
install node.js (unless you already have it downloaded)
TO CHECK: go into terminal and type: node -v
install homeBrew (unless you already have it downloaded)
To download: go into terminal and type: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
remember to read what it says on the terminal to fully download it (there should be like two other commands you put in)
install watchman, on terminal type: brew install watchman
on terminal uninstall all your cocoapod stuff. Check how to with this link: https://superuser.com/questions/686317/how-to-fully-uninstall-the-cocoapods-from-the-mac-machine
open up VScode
type npx react-native init TestProject
choose the method to install Cocoapods through Homebrew
This worked for me.
UPDATE
It stopped working without livereload too - so now it wasn't being cause by livereload - but I still need help with this problem
After the iOS 11 update (I think that is the cause of this because things were fine before), I am not able to use livereload. If I try to use livereload, it hangs on the splash screen - with the loading wheel spinning. Here is some info about my ionic environment:
Eamons-MBP:myapp eamonwhite$ ionic info
cli packages: (/Users/eamonwhite/ionicmane/myApp/node_modules)
#ionic/cli-utils : 1.12.0
ionic (Ionic CLI) : 3.12.0
global packages:
cordova (Cordova CLI) : 7.0.1
local packages:
#ionic/app-scripts : 1.3.12
Cordova Platforms : android 6.2.3 ios 4.4.0
Ionic Framework : ionic-angular 3.5.0
System:
ios-deploy : 1.9.2
ios-sim : 6.1.2
Node : v7.7.3
npm : 4.1.2
OS : macOS High Sierra
Xcode : Xcode 9.0 Build version 9A235
Misc:
backend : legacy
When I run it with xcode, it says this in the xcode console:
2017-10-10 15:49:17.417901-0400 myApp[8476:3520766] Resetting plugins due to page load.
2017-10-10 15:49:38.433127-0400 myApp[8476:3520766] Failed to load webpage with error: The request timed out.
In the ionic console, it stops before the deviceready event:
------ Debug phase ------
Starting debug of 2e5ac6066864be48322a757c4d0ccdfde52cf356 (N51AP, iPhone 5s (GSM), iphoneos, arm64) a.k.a. 'Eamon White’s iPhone' connected through USB...
[ 0%] Looking up developer disk image
[ 90%] Mounting developer disk image
[ 95%] Developer disk image already mounted
[100%] Connecting to remote debug server
-------------------------
(lldb) command source -s 0 '/tmp/2F06F4BB-A7E5-4B97-87EC-A01CBEE5661A/fruitstrap-lldb-prep-cmds-2e5ac6066864be48322a757c4d0ccdfde52cf356'
Executing commands in '/tmp/2F06F4BB-A7E5-4B97-87EC-A01CBEE5661A/fruitstrap-lldb-prep-cmds-2e5ac6066864be48322a757c4d0ccdfde52cf356'.
(lldb) platform select remote-ios --sysroot '/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols'
Platform: remote-ios
Connected: no
SDK Path: "/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols"
(lldb) target create "/Users/eamonwhite/ionicmane/myapp/platforms/ios/build/device/myApp.app"
Current executable set to '/Users/eamonwhite/ionicmane/myapp/platforms/ios/build/device/myApp.app' (arm64).
(lldb) script fruitstrap_device_app="/private/var/containers/Bundle/Application/5EBCC0EF-FDB9-4DE7-A961-D91B6139AEA0/myApp.app"
(lldb) script fruitstrap_connect_url="connect://127.0.0.1:50188"
(lldb) target modules search-paths add /usr "/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols/usr" /System "/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols/System" "/private/var/containers/Bundle/Application/5EBCC0EF-FDB9-4DE7-A961-D91B6139AEA0" "/Users/eamonwhite/ionicmane/myapp/platforms/ios/build/device" "/var/containers/Bundle/Application/5EBCC0EF-FDB9-4DE7-A961-D91B6139AEA0" "/Users/eamonwhite/ionicmane/myapp/platforms/ios/build/device" /Developer "/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols/Developer"
(lldb) command script import "/tmp/2F06F4BB-A7E5-4B97-87EC-A01CBEE5661A/fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.py"
(lldb) command script add -f fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.connect_command connect
(lldb) command script add -s asynchronous -f fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.run_command run
(lldb) command script add -s asynchronous -f fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.autoexit_command autoexit
(lldb) command script add -s asynchronous -f fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.safequit_command safequit
(lldb) connect
(lldb) run
success
(lldb) safequit
Process 7681 detached
Also, I updated my ios-deploy from 1.9.1 to 1.9.2 before this started happening.
Why can't I use livereload? Again, I think this might have something to do with the iOS 11 update. Does anybody know a workaround...I have read something about npm run watch but couldn't get it running.
I have created a blank app to see if that would run with livereload and it doesn't.
The wifi on my phone was off so it wasn't connecting to ionic.
I am trying to ionic cordova run ios -lcs or just -cs on an iphone 5s connected via usb to a mac (OSX 10.11.6).
The app runs on the iPhone but I don't see any JavaScript logs in the terminal. And I don't see the device listed in the Development menu in Safari.
ionic info
[ERROR] Error with
/Users/ludux/Documents/PROJETS/BOINE/dev/ne/www/lib/ionic/version.json
file: FILE_NOT_FOUND
global packages:
#ionic/cli-utils : 1.4.0
Cordova CLI : 7.0.1
Gulp CLI : not installed globally
Ionic CLI : 3.4.0
local packages:
#ionic/cli-plugin-cordova : 1.4.0
#ionic/cli-plugin-gulp : 1.0.1
#ionic/cli-plugin-ionic1 : 2.0.0
Cordova Platforms : ios 4.3.1
Ionic Framework : unknown
System:
Node : v7.2.0
OS : OS X El Capitan
Xcode : Xcode 8.2.1 Build version 8C1002
ios-deploy : 1.9.0
ios-sim : 5.0.8
npm : 3.10.9
End of compilation log in terminal:
------ Debug phase ------
Starting debug of iPhone 5s (Global/CDMA) 'iPhone de Lou' (5910f2d7cc2f113756d5de4b942029559ea0cd38) connected through USB...
[ 0%] Looking up developer disk image
[ 95%] Developer disk image mounted successfully
[100%] Connecting to remote debug server
-------------------------
(lldb) command source -s 0 '/tmp/E6C7DA82-1774-45A2-B4B2-0CD3988AE4BD/fruitstrap-lldb-prep-cmds-5910f2d7cc2f113756d5de4b942029559ea0cd38'
Executing commands in '/tmp/E6C7DA82-1774-45A2-B4B2-0CD3988AE4BD/fruitstrap-lldb-prep-cmds-5910f2d7cc2f113756d5de4b942029559ea0cd38'.
(lldb) platform select remote-ios --sysroot '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/10.2 (14C89)/Symbols'
Platform: remote-ios
Connected: no
SDK Path: "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/10.2 (14C89)/Symbols"
(lldb) target create "/Users/ludovicroux/Documents/PROJETS/BOARDLINE/dev/boardline/platforms/ios/build/device/BoardLine.app"
Current executable set to '/Users/ludovicroux/Documents/PROJETS/BOARDLINE/dev/boardline/platforms/ios/build/device/BoardLine.app' (arm64).
(lldb) script fruitstrap_device_app="/private/var/containers/Bundle/Application/13EA02BB-85A1-4818-ACDB-161AC1DDE62E/BoardLine.app"
(lldb) script fruitstrap_connect_url="connect://127.0.0.1:59590"
(lldb) command script import "/tmp/E6C7DA82-1774-45A2-B4B2-0CD3988AE4BD/fruitstrap_5910f2d7cc2f113756d5de4b942029559ea0cd38.py"
(lldb) command script add -f fruitstrap_5910f2d7cc2f113756d5de4b942029559ea0cd38.connect_command connect
(lldb) command script add -s asynchronous -f fruitstrap_5910f2d7cc2f113756d5de4b942029559ea0cd38.run_command run
(lldb) command script add -s asynchronous -f fruitstrap_5910f2d7cc2f113756d5de4b942029559ea0cd38.autoexit_command autoexit
(lldb) command script add -s asynchronous -f fruitstrap_5910f2d7cc2f113756d5de4b942029559ea0cd38.safequit_command safequit
(lldb) connect
(lldb) run
success
(lldb) safequit
Process 308 detached
(lldb)
After updating to the latest forge tools. I'm getting strange output when I run forge run CLI on OSX. Has anyone seen this, or know how to fix it?
thank you
output from forge run ios:
[ INFO] Forge tools running at version 3.3.68
[ INFO] Running on iOS device: 8f7798207a11e814971472e932bdc5a4741ba81c
[ INFO] Plist OK
[ INFO] 1 Provisioned Device(s):
[ INFO] ['8f7798207a11e814971472e932bdc5a4741ba81c']
[ INFO] Installing app on device 8f7798207a11e814971472e932bdc5a4741ba81c: is it connected?
[ INFO] ------ Install phase ------
[ INFO] [....] Waiting for iOS device to be connected
[ INFO] [ 0%] Found device (8f7798207a11e814sdfsdf971472e932bdc5a4741ba81c), beginning install
...
[ INFO] ------ Debug phase ------
[ INFO] [ 0%] Looking up developer disk image
[ INFO] [ 90%] Mounting developer disk image
[ INFO] [ 95%] Developer disk image already mounted
[ INFO] [100%] Connecting to remote debug server
[ INFO] -------------------------
[ INFO] sh: /Applications/TriggerToolkit.app/Contents/MacOS/python: cannot execute binary file
[ INFO] ^D
[ INFO] ^D
[ INFO] ^D
[ INFO] quit
[ INFO] quit
[ INFO] ^D
[ INFO] quit
[ INFO] quit
[ INFO] ^D
[ INFO] quit
[ INFO] ^D
[ INFO] quit
[ INFO] ^D
This looks like its because that command tries to run python and its attempting to run the wrong python (/Applications/TriggerToolkit.app/Contents/MacOS/python).
This is probably because you've added /Applications/TriggerToolkit.app/Contents/MacOS to the beginning of your PATH, if you move it to the end of your path then the correct python executable should be used.
After reinstalling (and I assume upgrading) the forge tool kit these errors went away.
I want to use parse.com push notifications in my Trigger.io solution, however, when I enable the partners parse.com option and opt to deploy to my iPhone (real device), I get the following error:
[ 48%] Copying /Users/Brady/forge-workspace/rj/development/ios/device-ios.app//retina.png to device
[ 49%] Copying /Users/Brady/forge-workspace/rj/development/ios/device-ios.app//tabs_modalWebViewController.nib to device
[ 50%] TakingInstallLock
[ 52%] CreatingStagingDirectory
[ 57%] ExtractingPackage
[ 60%] InspectingPackage
[ 65%] PreflightingApplication
[ 70%] VerifyingApplication
[ 70%] InstallingEmbeddedProfile
AMDeviceInstallApplication failed: -402620394
The solution deploys successfully to the iOS simulator - just not an real device/iPhone.
You need to setup your certificates and entitlements correctly per these instructions:
https://www.parse.com/docs/ios_guide#push
Then you'll need to specify your provisioning profile and certificates in your Trigger.io local config:
http://docs.trigger.io/en/v1.4/tools/local-config.html
If you still have problems, please contact support#trigger.io sending your config.json and local_config.json.