Cannot start React Native 0.15 anymore - ios

I have problems with newly initiated projects. When I do a init, I ger react native version 0.16.0-rc. the plugins I need does not support v0.16, so downgrade is the only option.
Downgrading to 0.15 seems ok, but running it i XCode result in build failure.
Reproducing steps:
react-native init AwesomeProject
cd AwesomeProject/
vi package.json
Change 0.16.0-rc to 0.15.0
npm cache clean
npm install
Open Xcode, click run.
I get following errors:
Anybody seen this problem before?
I am using:
Xcode 7.1.1
OS X El Capitan 10.11.1 (15B42)
Node v5.1.0

You can safely delete the AwesomeProjectTests/AwesomeProjectTests.m file as it's only for testing the Sample "Welcome to React Native" screen.
Edit: It should be noted that the file reference also needs to be removed from the Xcode project file. To do this all at once, in the Xcode editor, find the AwesomeProjectTests/AwesomeProjectTests.m file, right click it, then click "Delete". Xcode will ask, "Do you want to move “AwesomeProjectsTests.m” to the Trash, or only remove the reference to it?" You want to click "Move to Trash".

Related

Can't build on Xcode using 'capacitor js' commands

I'm practicing capacitor js, and was able successfully to package the (html, css & js) files and build them on 'android studio' according to the commands on 'https://capacitorjs.com/docs/android'.
Yet when i powered up macOS version 10.14 on VMware and tried to do the same steps 'https://capacitorjs.com/docs/ios' to build on Xcode, the following warnings and errors occured...
Bugs
I traced the path written in the error and couldn't find neither file nor folder named Pods....
The App folder
I'm using XCode version 11.3 and did install 'Node.js & Xcode command line tools' as mentioned as "capacitor js requirements" on the documentation, also installed CocoaPods.
It's my first time using macOS so I might have missed some additional steps that needed to be done.
Would be very thankful if anyone could guide me through that bug.
Looks like you've openend the .xcodeproj file. Don't do that, use the .xcworkspace exclusively. Also, if you don't have a Pods folder, you probably forgot to run pod install
Thanks to Gereon the step that was missing is to use the command pod install on the 'App' folder that has the 'Podfile.txt', it will extract some extra files including the required Pods folder.
App Folder After Using pod install
If after building you faced the following error...
failed to initiate service connection to simulator
Just clean the build folder and run again.
To clean the build folder you can use the shortcut Command+Option+Shift+K or Menu Bar → Product → Hold Option Key → Clean build Folder.

react-native-camera is not working in iOS

Hi I want to use camera in my react-native app.
For this I am following this:
https://github.com/react-native-community/react-native-camera
Its is running in Android in Windows Machine, but while am coming to iOS it is not running Mac OS.
The app is installed and loading app name and then it is crashed in iPhone.
Some times its showing an error like react-native-implementation.js: cannot read property 'bindings' of null (null)
For solving this issue, manually added this module to my project like below
Manual install iOS
npm install react-native-camera --save
In XCode, in the project navigator, right click Libraries ➜ Add Files to [your project's name]
Go to node_modules ➜ react-native-camera and add RNCamera.xcodeproj
Expand the RNCamera.xcodeproj ➜ Products folder
In XCode, in the project navigator, select your project.
Add libRNCamera.a to your project's Build Phases ➜ Link Binary With Libraries
Click RNCamera.xcodeproj in the project navigator and go the Build Settings tab.
Make sure 'All' is toggled on (instead of 'Basic').
In the Search Paths section, look for Header Search Paths and make sure it contains both $(SRCROOT)/../../react-native/React and $(SRCROOT)/../../../React - mark both as recursive.
My System configuration:
I am using the PyCharm Editor for implementing my react-native projects.
npm: 6.1.0
react-native-cli: 2.0.1
react-native: 0.56.0
macOS HighSierra 10.13.5
Xcode 9.4.1.
This Bug seems related to upgrading to react-native#0.56.0.
Unfortunately there is no general solution yet. It will probably be fixed in react-native#0.56.1.
You should follow https://github.com/facebook/react-native/issues/20074 and linked issues.
Meanwhile try to use an older version of react-native like 0.55.4.

‘Cordova/CDV.h’ file not found in Xcode 8.2.1

I have one hybrid Cordova project, which is running fine Xcode 5.1.1, but when I am trying to Archive the project in Xcode 8.2.1 with ‘Generic iOS Device’ I am getting the error ‘Cordova/CDV.h’ is not found.
I read many articles about this problem, but none could solve my problem. Most answers are telling to follow the below steps:
"Add this line to your Build Settings -> Header Search Paths:
$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include
"
I have did this but problem not solved, getting another error ‘ld: library not found for -lcrt1.3.1.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)’
Also I have changed the bitcode YES to NO in target Build Settings, but no fruitful result.
Project cordova version 3.4.0 where installed cordova version in machine 6.4.0
Has anybody experience with this kind of problem?
Please, can anyone help? I've been working on this for days.
I got it work by following below steps
In your Xcode project settings select TARGETS
Within TARGETS select the Build Settings tab
In the sub-options under the Build Settings tab be sure to select All
Scroll down to the Search Paths section
Locate Header Search Paths
Add the following configuration to the Release option (as a new value on its own line): $(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include
Clean the project: Command + Shift + K
Restart Xcode
I wanted to report that the response provided by Vinay worked for me. I had to make sure I was in the share extension target, and I added it to the path exactly as suggested above in the Release option, and did not even have to do a clean to get it to regenerate the PCH.
BUT, I was puzzled by this after looking at the setting further and I realized this path was already in the setting. I edited it again, and removed the redundant path, hit 'run' again, and it loaded onto my iPhone and ran fine.
So, I believe that just setting this in the search path forced a recompile on the share extension PCH and all is working again.
I hope this helps others.
I know its too late to answer on this question but still many developers facing the above issue and as per the latest Cordova & ionic version below steps will work in the above error.
As per new update in Cordova some time due to some permission issue or directly run or build iOS platform it's unable to add below file or folders in your iOS project platform :
CordovaLib
so somehow above folder will not add in your project and that's why it's not building your iOS project.
To overcome this issue you need to remove iOS platform from your ionic project and again add it.
Remove iOS platform: sudo ionic cordova platform remove ios
Add it again: sudo ionic cordova platform add ios
By doing this cordova download CordovaLib folder from server and add it into your iOS project and after that users can able to build their project without any error.
recently I faced this issue and I solved by doing the above steps.
Hope this helps others.
Happy coding!
Seems like the "Cordova" folder isn't getting copied into the project during cordova platform add ios
So, you'll have to copy the "Cordova" source folder into your project manually. But you'll have to download the ios source packages from github first, which is located at:
https://github.com/apache/cordova-ios
After downloading the "cordova-ios-master.zip" package and unzipping it, copy the folder named "CordovaLib" into your project next to the Xcode project file:
PROJECT_FOLDER/platforms/ios/PROJECT_NAME
PROJECT_FOLDER/platforms/ios/PROJECT_NAME.xcodeproj
PROJECT_FOLDER/platforms/ios/PROJECT_NAME.xcworkspace
PROJECT_FOLDER/platforms/ios/cordova
PROJECT_FOLDER/platforms/ios/CordovaLib <------- here
PROJECT_FOLDER/platforms/ios/ios.json
PROJECT_FOLDER/platforms/ios/platform_www
PROJECT_FOLDER/platforms/ios/pods-debug.xcconfig
PROJECT_FOLDER/platforms/ios/pods-release.xcconfig
PROJECT_FOLDER/platforms/ios/www

Crashlytics in iOS won't proceed past "Build Your Project" in Fabric app

I'm installing Crashlytics for my iOS app. I downloaded it via their site link, and went through all the steps for integrating the frameworks, adding the run script, etc.
I was experiencing an issue, so I removed the frameworks and decided to start over and try a fresh install. But the Fabric app updated to a newer version, and now when I try to reinstall Crashlytics into my app, it doesn't give me the option to reinstall the frameworks. It goes straight from clicking "install" to the "Build your project" screen, which I cannot pass.
To help configure your project, please build it now by pressing ⌘B
I press ⌘B, it builds and nothing happens. I think the issue is because I removed the Crashlytics and Fabric frameworks from my project, but I can't see a way to add them back again. The Fabric app doesn't give me that option.
Go into Build settings of the your target.
Find "Debug Information Format".
Set this from "DWARF" in both debug and release to "DWARF with dSYM File"
Moving from Comment to Answer.
Mike from Fabric here. If you back up through the Mac app, then click on the arrow in the top-left, click on "+ New App", that will walk you through re-adding everything.
If you check the resource navigator you may see the following message:
"DEBUG_INFORMATION_FORMAT should be set to dwarf-with-dsym for all configurations. This could also be a timing issue, make sure the Fabric run script build phase is the last build phase and no other scripts have moved the dSYM from the location Xcode generated it. Unable to process eCreditWebWrapper.app.dSYM at path"
Go to Build Settings and search for "Debug Information Format". Ensure "Debug" is set to "DWARF with dSYM File".
Without the dSYM file Fabric won't work.
As for Xcode 10.2.1, the automated installation via Fabric Mac app won't work anymore. New apps cannot be added via the New App Step-by-step guide.
You have to follow the manual installation instructions. Download and add the 2 frameworks into your Xcode workspace, then add the Run Build Script phase (and related Fabric codes), then build the App. Last (very important), run the app in an actual device.
Once the App is successfully launched, the new App information will be available in the Fabric dashboard as well as the Fabric Mac App (needs to relaunch the App to see the new app).
Here are the steps:
Download the 2 frameworks
Drag to your project where your App Delegate is (make sure ticked "Copy items if needed")
Compile the project / workspace in Xcode
Add the "Run Script Phase" as instructed here; note that Xcode 10+ requires an extra configuration at Input Files
Add the required import and initialization codes in App Delegate
Add the Fabric API keys in Info.plist
Compile again
Run the App in a real device. You will see the line Crashlytics in the Xcode log. If no log appears, checks if your active scheme contains OS_ACTIVITY_MODE settings. Set it to default if the current setting is disabled.
If the Crashlytics line appears, that means the manual installation is working; you will see your App appearing at Fabric online dashboard.
I have solved this issue by the following way. Following the advise from above, I began adding a new app to crashlytics. When I reached to adding new "Run script" build phase, I just copied that text and pasted it over the previous one(created with Crashlytics).
I have also unchecked "Run script only when installing".
After this, I canceleed adding a new app and procedeed back to the UPGRADE. At this moment, building the app, can pass you to the next step and you don't get stuck on that screen anymore.
I was stucked on Build phases too.
I have also unchecked "Run script only when installing" and press again command+B and then I passed to the next step.
If the script is not running, you may have checked the "run script only when installing" in the run script section.
I hope it helps
TL;DR
Tap your scheme -> edit scheme -> set build configuration to "Release"
Explanation:
The most voted answer sounds about right, but there are situations where you just don't need crashlytics in debug builds (who wants crashes sent when you just develop and experiment with your code?). In this case you should disable crashlytics by checking debug compilation flags (out of scope of this answer) and for the first time during installation build app for release to let crashlytics know that you built app.
I had the same issue today. The problem was that i didn't have the run-script :
./Fabric.framework/run <api key>
in my project. Once i put this back in then it all worked perfectly. I also cleaned my project and deleted derived data just to be sure.
you must check that your deployment target version because of "Fabric's minimum iOS version is 6.0"
I was only able to get the Fabric app to continue the installation process after setting my build target to 'Generic iOS Device' and creating an archive from the Product > Archive menu.
Simply building the app or running it on an emulator doesn't seem to trigger the Fabric App to proceed.
If you use Xcode 10.
Project Navigator -> your project -> Targets -> Build Phases -> your Run Script for Fabric -> Input Files -> "+" (add input file) -> clear field and past this line:
$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
Be sure to remove this: $(SRCROOT)/
In the Run Script build phase there is a call:
./Crashlytics.framework/run <your_api_key_here>
Maybe you added some conditions to trigger it only on certain builds like:
releaseConfig="Release"
if [ "$releaseConfig" = "${CONFIGURATION}" ]; then
echo "Running Crashlytics"
./Crashlytics.framework/run <your_api_key_here>
fi
so that it will not just trigger on ⌘B
See https://dev.twitter.com/crashlytics/ios/advanced-setup
In my situation I was following all the steps correctly but got stuck on 'add build phase' step.
Then I just restarted fabric and all works just fine
Also there are some other possible actions:
1) Just restart Fabric, Xcode and your Mac.
2) Also if you use Cocoapods change build phase line from
./Crashlytics.framework/run [yourAPIKey]
to
"${PODS_ROOT}/Fabric/run" [yourAPIKey]
3) After building project if Fabric will stop responding just wait a while. It took about minute on my Mac.
Thanks, I solved the problem by removing folders:
~ / Library / Caches / com.crashlytics.data
~ / Library / Caches / com.crashlytics.mac
Kindly cross verify that run script you adding is to your actual target if u will add to tests target it will not proceed until you add it to actual target
None of the solutions here worked for me. The scenario for me was someone else added the Fabric framework to our project and committed it to the repo. The run script on their computer launched/triggered the Fabric Plugin, but would not launch/trigger on mine, although it did not report errors.
The solution was to create a separate project, using Cocoapods download the same version of Fabric, replace the run script in our project/repo (and the one referenced in the target's run script) with the downloaded version from Cocoapods. Rebuild and then the plugin would respond.
Comparing the two run script files, they are drastically different, but the run script from Cocoapods was not a flat text file and it was unreadable. So I'm not sure what was different between the scripts, but we somehow got different versions of the script while using the same version of Fabric.
What I did wrong was adding the script to the pods project build phase instead of the main project build phase, adding it to the main projects build phase solved the problem.
If you are duplicating the target, remove the run script from build phase and add it again to solve the issue.
If you have multiple TARGETS,
check your Schema selection is correct before you build project.
For Xcode 10. Add your app's built Info.plist location to the Build Phase's Input Files field:
$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
This solved my issue i hope this can solve others issue.
It turned out I had not enough permissions to create new project in Fabric.
Upgrading from Member to Admin resolved the issue.
In my case, removing an app from helped.
1) Remove the app from Fabric.
2) Follow all the steps again to add the app and install Crashlytics.
Nothing helped me. Now Fabric catches my archive creation. But I create the archives via fastlane's build_app.
Open Project in higher version of Xcode. This resolved my issue after waste many hours.
My Project build on Xcode 10.2 and I was running on Xcode 10.1 but when I run the same project on Xocode 11. The build was succeeded.
Try to wrap your run script variable with double quotes ""
"${PODS_ROOT}/Fabric/run"
Go to folder /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/<CURRENT_IOS_SDK>/usr/lib/ and delete all .dylib files.
It worked for me.

List command hangs in xcode

I am using the Jenkins Xcode plugin (https://wiki.jenkins-ci.org/display/JENKINS/Xcode+Plugin) to build an iOS application, however it hangs when running the following command on a project I have inherited from another developer:
$ /usr/bin/xcodebuild -list
It also hangs when I run this command manually from a terminal. Does anyone know what the cause may be? The warning displayed is also displayed on another project I have, but it does not hang in this case.
Running Xcode 6.1 on OS X 10.10
$ /usr/bin/xcodebuild -list
2014-11-12 04:47:21.234 xcodebuild[42642:1431240] [MT] DVTAssertions: Warning in /SourceCache/IDEFrameworks/IDEFrameworks-6604/IDEFoundation/SourceControl/Model/IDESourceControlManager.m:423
Details: Error Domain=com.apple.dt.IDESourceControlErrorDomain Code=-1 "Missing extension: public.vcs.subversion" UserInfo=0x7f9792309200 {NSLocalizedDescription=Missing extension: public.vcs.subversion}
Object: <IDESourceControlManager: 0x7f9792302860>
Method: -loadRepositories
Thread: <NSThread: 0x7f9790d2dbe0>{number = 1, name = main}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
Information about project "DOHSmokefree":
Targets:
DOHSmokefree
DOHSmokefreeTests
Build Configurations:
Debug
Release
If no build configuration is specified and -scheme is not passed then "Release" is used.
TLDR; My solution: Mark the schemes as shared in XCode if building them from the command line as a different user, or without ever opening XCode on the build machine.
I was having this same problem, intermittently on our CI server. I came across this question. The accepted answer with the problem being an issue and fixing the SVN version did not work for me as the SVN being used on the CI server was the default SVN and it was, as mentioned, working intermittently.
What I finally noticed is that, between a working version and a non-working version the schemes were not being listed. I had recently upgraded a library on the project and that got me to thinking about the schemes. After realizing that schemes are stored locally per user, unless shared, the fix for me was to go into the scheme manager and mark the schemes as shared.
The problem apparently being that the CI server user never actually opened the project in Xcode, thus causing the list command to hang because there were no available schemes for the user to build.
The times when it had intermittently worked were times after, logged in as the CI server user, I had opened the project in Xcode to test the build process, thus creating the necessary schemes. Wiping the CI server or refactoring/adding schemes would cause the build to break until the project was reopened in Xcode in desperation.
I had a similar issue when updating to Xcode 6.1 while using a newer version of subversion on the command line.
Disabling Source Control in Xcode Preferences should do the trick.
If that isn't an option you might try replacing the subversion implementation inside Xcode as I have done, using this technique: Use SVN 1.7 in XCode 4.3+
Basically that would be the following steps:
This assumes you already have SVN 1.7 installed to /opt/subversion, you can get it from WANdisco: http://www.wandisco.com/subversion/download#osx
Now open the Terminal and get an elevated shell using sudo -s.
Then, cd to inside the XCode.app package, to where the SVN binaries are.
Make a backup directory and move the old SVN files into it
bash-3.2# mkdir bup
bash-3.2# mv svn* bup/
Lastly, symbolically link the new files into the package:
bash-3.2# ln -s /opt/subversion/bin/svn* ./
That’s it!
I have the same problem on OS X 10.10 with XCode 6.4,just close XCode's Source Control to solved this issue:
run XCode
open Menu: XCode -> Preferences...
Click "Source Control" Tab and uncheck "Enable Source Control"

Resources