I'm trying to add Fabric to my project, which is using CocoaPods with Carthage. What I did:
In Fabric app, I've created a new app
In the project I've created new run script called 'Fabric', copied the code from Fabric app (the script is the last script in my project!)
Because the framework file couldn't be found, I've added proper path to Framework Search Paths.
I've also added Fabric framework to my project Link Binary with Libraries stage.
The project still does not build. The error:
2015-07-14 10:51:30.161 run[46263:967908] Fabric.framework/run 1.3.16
2015-07-14 10:51:30.169 run[46263:967908]
Fabric: dSYM Error
Unable to process MyApp.app.dSYM at path
/Users/me/Library/Developer/Xcode/DerivedData/MyApp-gmgvycoixcnkriauasdffkzvdg/Build/Products/Debug-iphonesimulator/MyApp.app.dSYM
Make sure your project build settings are generating a dSYM file.
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.
Command /bin/sh failed with exit code 1
What is wrong..? How to fix it?
Got it. When moving framework to different folder I forgot to change run script from:
./Fabric.framework/run ...
to:
./Frameworks/Fabric.framework/run ...
Everything is working now.
Related
I'm trying to follow the instructions here (for iOS) for setting up multiple environments for my React Native project. The idea is that I can make use of Build Phases to copy any plist into GoogleService-Info.plist to enable the use of different Firebase environments for different Xcode schemes.
I've made a user-defined build setting for each of my 4 Xcode configurations called GOOGLE_SERVICE_PLIST_SUFFIX, and I have a build phase (it's the first one that's run before React native Copies and Bundles its required assets) with the following code:
cp -r "GoogleService-Info"$GOOGLE_SERVICE_PLIST_SUFFIX".plist" "GoogleService-Info.plist" &
wait $!
echo "${GOOGLE_SERVICE_PLIST_SUFFIX} Firebase plist copied"
I can tell that the copying is indeed successful, but for some reason the build fails with this error:
The following build commands failed:
CopyPlistFile /Users/andersonaddo/myappname/ios/build/biteup/Build/Products/Prod.Debug-iphonesimulator/Myappname.app/GoogleService-Info.plist /Users/andersonaddo/myappname/ios/GoogleService-Info.plist
(1 failure)
Looking at the error trace, this error is explained a bit further:
CopyPlistFile /Users/andersonaddo/myappname/ios/build/myappname/Build/Products/Prod.Debug-iphonesimulator/Myappname.app/GoogleService-Info.plist /Users/andersonaddo/myappname/ios/GoogleService-Info.plist (in target 'myappname' from project 'myappname')
cd /Users/andersonaddo/myappname/ios
builtin-copyPlist --convert binary1 --outdir /Users/andersonaddo/myappname/ios/build/myappname/Build/Products/Prod.Debug-iphonesimulator/Biteup.app -- /Users/andersonaddo/myappname/ios/GoogleService-Info.plist
error: Build input file cannot be found: '/Users/andersonaddo/lunchme/ios/GoogleService-Info.plist' (in target 'biteup' from project 'biteup')
Does anyone have any idea why this behaviour may be happening? If i try and build again after the first failure, I don't run into this issue because the copied file remains in the ios directory from the first attempt.
I've achieved a similar outcome to what you are after by using schemes and a build script against each scheme.
I used an approach similar to what's details here to set up alpha (dev), beta (stage) and prod builds:
https://blog.echobind.com/a-12-factor-approach-to-environment-specific-builds-in-react-native-ae1fb77ed799
Then I set up the 3 apps in Firebase and saved the plist files in my app with relevant names (eg GoogleService-Info-beta.plist).
Lastly, I added to the run script for each scheme (as below) and it works great.
RN # 0.62.2, RNFB # v7.1.0
I've added the file that gets copied to (GoogleService-Info.plist) to my gitignore as it obv changes when I run diff schemes on my machine
How to upload dSYM file. please help us. I am using “Pods/Fabric” folder of your Xcode project directory
finally i got issue
vicky-MacBook-Air-2:~ vicky$ /Users/vicky/Documents/Office/CAADE\ MAIN/Caade_12.2/Caade\ 12.2/Pods/Fabric/upload-symbols -a <85ffrf2c3dc15de343dfdf0bbbbdfe083115fb50> -p ios /Users/vicky/Desktop/CTCaade.app.dSYM
-bash: 89ffbf2c3dc15dee4677690bbbbdfe083115fb50: No such file or directory
You can initialize Crashlytics by adding a run script to your project’s build phase. The run script allows Xcode to automatically upload your project’s dSYM file whenever your app crashes so that Crashlytics can automatically generate crash reports.
- Make sure your new build phase is the project's last build phase or Crashlytics can't initialize properly.
- make sure Fabric org id is correct.
If you still get in to the issues - Write to the FirebaseSupport and include your app name bundle id , Firebase Project id.
Trying to remove fabric from an IOS project I'm working on. I have removed it from the pod file(s) and did a pod install. (When saying fabric onwards I mean both fabric and crashlytics)
I have removed any references to Fabric in the code by searching the project with cmd+shift+f. And clean the build folder.
Then when building I get the following error:
/Users/just_user/Library/Developer/Xcode/DerivedData/TheApp-epakvsyxjlzjjfclvjqwrljowaio/Build/Intermediates.noindex/TheAppMobile.build/Debug-iphoneos/TheAppMobile.build/Script-CF862497221C49250071D547.sh: line 2: /Users/just_user/Projects/TheApp/app/TheAppMobile/../Pods/Fabric/run: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code
So obviously some reference left somewhere.
So I used Finder to search the project for any references to Fabric which resulted in a lot of references still there not visible via Xcode. I removed all of those references too.
Then cleaned cache of cocoapods, re-installed the pods again. Cleaned build folder and the result is the same as the error above.
Then I deleted the "Users/just_user/Library/Developer/Xcode/DerivedData/TheApp-epakvsyxjlzjjfclvjqwrljowaio/" folder and cleaned and build everything again. Nope, error still there.
What else could it be which isn't visible through xcode and finder searches that keeps a reference to Fabric?
From the error, it seems you forgot to remove Run script phase for Fabric under Build phases for your target:
I have a project which uses the ADALiOS project. This project is included in my project, and it works all fine when building to debug on my phone. However, I want to submit the App to the App Store and Archive but I get the following error:
PhaseScriptExecution Run\ Script /Users/User/Library/Developer/Xcode/DerivedData/projectX-gperwbbtttggqpcvozenraexrhrx/Build/Intermediates/ArchiveIntermediates/projectX\ Dev/IntermediateBuildFilesPath/ADALiOS.build/Release-iphoneos/ADALiOS.build/Script-8B19339718BAEDE4008FD93A.sh
cd "/Users/User/Documents/Xcode development/azure-activedirectory-library-for-objc/ADALiOS"
/bin/sh -c \"/Users/User/Library/Developer/Xcode/DerivedData/projectX-gperwbbtttggqpcvozenraexrhrx/Build/Intermediates/ArchiveIntermediates/projectX\ Dev/IntermediateBuildFilesPath/ADALiOS.build/Release-iphoneos/ADALiOS.build/Script-8B19339718BAEDE4008FD93A.sh\"
Creating Framework folder structure at /Users/User/Library/Developer/Xcode/DerivedData/projectX-gperwbbtttggqpcvozenraexrhrx/Build/Intermediates/ArchiveIntermediates/projectX Dev/BuildProductsPath/Release-iphoneos/ADALiOS
Copying public headers from /Users/User/Library/Developer/Xcode/DerivedData/projectX-gperwbbtttggqpcvozenraexrhrx/Build/Intermediates/ArchiveIntermediates/projectX Dev/InstallationBuildProductsLocation/usr/local/lib/Headers/ADALiOS/
cp: /Users/User/Library/Developer/Xcode/DerivedData/projectX-gperwbbtttggqpcvozenraexrhrx/Build/Intermediates/ArchiveIntermediates/projectX Dev/InstallationBuildProductsLocation/usr/local/lib/Headers/ADALiOS/: No such file or directory
I am Archiving using the 'Generic iOS Device' option. I have tried a clean build followed many hints from other build problems but nothing seems to help.
Any suggestion on what could be wrong?
[EDIT:]
I got a clean version of the ADALiOS git repo and this too builds, but does not achieve with the same problem, so it could be related to the ADALiOS project, even though I do not knowhow and why.
I recently added SwiftyJSON into my xCode project using Carthage.
Cartfile
$ cat Cartfile
github "SwiftyJSON/SwiftyJSON" >= 2.1.2
I ran this command to install SwiftyJSON
$ carthage update
I added the built Framework to my xCode project
I imported the Framework at the top of my project
But I still get this error:
Use of unresolved identifier 'JSON'
Seriously, what am I doing wrong? I'm new to iOS development.
UPDATE: I tried removing the Frameworks and re-dragging the frameworks to the Linked Frameworks and Libraries and Adding the "Run Script" section to "Build Phases" as the instructions in Carthage asked.
I'm convinced that something went awry during the Carthage Update process because I received this error on my initial attempt:
$ carthage update
*** Fetching SwiftyJSON
*** Fetching Alamofire
*** Checking out SwiftyJSON at "2.1.3"
*** Checking out Alamofire at "1.1.4"
*** xcodebuild output can be found in /var/folders/0x/swzt630n3_575tglljpwhn4h0000gn/T/carthage-xcodebuild.Pc6rLg.log
*** Building scheme "Alamofire iOS" in Alamofire.xcworkspace
*** Building scheme "Alamofire OSX" in Alamofire.xcworkspace
*** Building scheme "SwiftyJSON" in SwiftyJSON.xcworkspace
** BUILD FAILED **
The following build commands failed:
Check dependencies
(1 failure)
After looking up the problem, I was told that you could run
carthage update --configuration Debug
Which installed it fine, but something is still amiss...
It seems like you missed a step during the addition of SwiftyJSON and Alamofire frameworks from Carthage. Check out these steps from the Carthage readme page :
Steps :
Create a Cartfile that lists the frameworks you’d like to use in your project.
Run carthage update. This will fetch dependencies into a Carthage/Checkouts folder, then build each one.
On your application targets’ “General” settings tab, in the “Linked Frameworks and Libraries” section, drag and drop each framework you want to use from the Carthage/Build folder on disk.
On your application targets’ “Build Phases” settings tab, click the “+” icon and choose “New Run Script Phase”. Create a Run Script with the following contents:
/usr/local/bin/carthage copy-frameworks
and add the paths to the frameworks you want to use under “Input Files”, e.g.:
$(SRCROOT)/Carthage/Build/iOS/Alamofire.framework
$(SRCROOT)/Carthage/Build/iOS/SwiftyJSON.framework
Looks like you missed step 4. I tried these steps myself in a demo Swift project and they are working great. Try these steps out, and if you still have problems, leave a comment. Thanks!
I switched over to Cocoapods and it just worked. Again, I'm a total noob when it comes to iOS development. When looking for a dependency manger I looked at Cocoapods and Carthage for what they had to offer. I was intrigued by Carthage's claim of keeping things simple:
"Carthage because we wanted the simplest tool possible—a dependency manager that gets the job done without taking over the responsibility of Xcode"
While I always will choose the simpler tool when given a choice, I think I don't know enough of the iOS ecosystem (read: Xcode) to use Carthage.
TL,DR: Can't use it inside of Emulator, Use iPhone.
I also followed your way, and I found out that --configuration debug will code-sign "iOS Developer" identity as SwiftyJSON's project property.
AFAIK, Code-signed "iOS Developer" identity wasn't run with Emulator.
My issue was resolved when I run it at my iPhone 6.
I do not know why you can not add this resource with help of Carthage but if you need use SwiftyJSON you only need:
Enter this URL: SwiftyJSON
Clic the button "Clone or download" and then in "Download ZIP" like the next image shows:
Clic the button "Clone or download" and then in "Download ZIP" IMG
You will get a ZIP file with name "SwiftyJSON-master"
Extract the files
Enter the path:
SwiftyJSON-master/Source/
You will see a file with name:
SwiftyJSON.swift
Copy that file into the files of your project.
Add that file into your project directory.
That file will be like other class into your project that you may use.