ios Hello World Sample Not Running

334 views
Skip to first unread message

Satinder Singh

unread,
Oct 29, 2015, 6:14:41 PM10/29/15
to grpc.io
I am trying to run the following sample hello world application involving grpc found in the first link below. When I do a pod install, hundreds of lines of warning come up due to Xcodeproj Generated duplicate UUIDs. I then opened helloworld.xcworkspace under Xcode 7.1 which showed 16 compiler errors for this project. A list of these errors is provided in the second link. The errors consist mainly of modules that cannot be built such as Darwin, CoreFoundation, UIKit. Any suggestions would be appreciated. 

https://github.com/grpc/grpc/tree/master/examples/objective-c/helloworld

Jorge Canizales

unread,
Oct 30, 2015, 2:34:55 PM10/30/15
to grpc.io
Hi Satinder, sorry for your troubles!

Those Cocoapods warnings are, according to the Cocoapods authors, harmless. They are caused by a Cocoapods feature called "deterministic IDs", which is useful but not essential; it can be disabled by settting the environment variable COCOAPODS_DISABLE_DETERMINISTIC_UUIDS=YES. I would love to know how to silence just the warning without telling people to disable the feature.

The compile errors you're seeing I'm not able to replicate them so far, neither in the master nor in the release-0_11 branch. I'm using XCode 7.1 too. What steps did you follow since cloning the repo?

Cheers,
Jorge

Satinder Singh

unread,
Oct 30, 2015, 3:23:30 PM10/30/15
to grpc.io
I retraced my installation process below. I pasted only the beginning and the end of the CocoaPod warning in bold because it spans for about 300  lines. It's strange that it shows duplicated UUIDS even though I set the environment variable to NO.

curl -fsSL https://goo.gl/getgrpc | bash -s plugins
pushd ../../cpp/helloworld
make
./greeter_server &
popd
pod install
COCOAPODS_DISABLE_DETERMINISTIC_UUIDS=YES
Analyzing dependencies
Fetching podspec for `HelloWorld` from `.`
Fetching podspec for `Protobuf` from `../../../third_party/protobuf`
[!] No podspec found for `Protobuf` in `../../../third_party/protobuf`

[!] CocoaPods was not able to update the `master` repo. If this is an unexpected issue and persists you can inspect it running `pod repo update --verbose`

git branch
* master

cd ../../../grc/
git submodule update --init
cd examples/objective-c/helloworld/
pod install
[!] This is a test version we'd love you to try.

For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.

Analyzing dependencies
Fetching podspec for `HelloWorld` from `.`
Fetching podspec for `Protobuf` from `../../../third_party/protobuf`
Fetching podspec for `gRPC` from `../../..`
Downloading dependencies
Installing HelloWorld (0.0.1)
Installing OpenSSL (1.0.204.1)
Installing Protobuf (3.0.0-alpha-4)
Installing gRPC (0.11.2)
Generating Pods project
2015-10-30 12:20:58.999 ruby[54889:3054517] warning:  The file reference for "context.h" is a member of multiple groups ("census" and "channel"); this indicates a malformed project.  Only the membership in one of the groups will be preserved (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference to the same path.
Integrating client project

[!] Please close any current Xcode sessions and use `HelloWorld.xcworkspace` for this project from now on.
Sending stats

[!] CocoaPods was not able to update the `master` repo. If this is an unexpected issue and persists you can inspect it running `pod repo update --verbose`

[!] [Xcodeproj] Generated duplicate UUIDs:

PBXFileReference -- /targets/buildConfigurationList:buildConfigurations:baseConfigurationReference:|,buildSettings:|,displayName:|,isa:|,name:|,,baseConfigurationReference:|,buildSettings:|,displayName:|,isa:|,name:|,,defaultConfigurationIsVisible:0,defaultConfigurationName:Release,displayName:ConfigurationList,isa:XCConfigurationList,,buildPhases:buildActionMask:2147483647,displayName:SourcesBuildPhase,files:|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,| ............ lastKnownFileType:|,path:|,sourceTree:|,,isa:PBXBuildFile,,isa:PBXHeadersBuildPhase,runOnlyForDeploymentPostprocessing:0,/files/displayName:context.h,fileRef:displayName:context.h,includeInIndex:1,isa:PBXFileReference,lastKnownFileType:sourcecode.c.h,path:context.h,sourceTree:<group>,,isa:PBXBuildFile,

[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `HelloWorld` to `Pods/Target Support Files/Pods/Pods.debug.xcconfig` or include the `Pods/Target Support Files/Pods/Pods.debug.xcconfig` in your build configuration.

[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `HelloWorld` to `Pods/Target Support Files/Pods/Pods.release.xcconfig` or include the `Pods/Target Support Files/Pods/Pods.release.xcconfig` in your build configuration.
open HelloWorld.xcworkspace/

Satinder Singh

unread,
Oct 30, 2015, 5:22:06 PM10/30/15
to grpc.io
I noticed I used curl -fsSL https://goo.gl/getgrpc | bash -s plugins instead of curl -fsSL https://goo.gl/getgrpc | bash -s
Even after correcting this mistake, I am still experiencing the same issue.

Satinder Singh

unread,
Oct 30, 2015, 7:05:30 PM10/30/15
to grpc.io
I got it to work by removing and reinstalling everything and doing a clean + build on Xcode. It was a bit strange that I had to edit the scheme so it would run the executable. For any users in the future who hit the run button and it only builds, make sure to go into Product > Scheme > Edit Scheme. Then within the Run SideBar, change Executable from None to HelloWorld.app

Jorge Canizales

unread,
Oct 30, 2015, 7:10:14 PM10/30/15
to grpc.io
Re the Cocoapods warnings, I think you just need to change
$ COCOAPODS_DISABLE_DETERMINISTIC_UUIDS=YES
into:
$ export COCOAPODS_DISABLE_DETERMINISTIC_UUIDS=YES

That should fix it for all subsequent pod installs. Alternatively, if you want it only for one specific invocation of pod install you can do:

$ COCOAPODS_DISABLE_DETERMINISTIC_UUIDS=YES pod install


I'm doing these steps locally:

curl -fsSL https://goo.gl/getgrpc | bash -s
git submodule update --init
cd examples/objective-c/helloworld/
pod install
open HelloWorld.xcworkspace

And the workspace that opens builds without errors. (It has warnings in GPBDictionary that the Protobuf guys are fixing, and another warning due to Cocoapods that I'll try to fix).

I'm shooting in the dark here, but Stack Overflow suggests looking at the Base SDK and Deployment Target of your project...

Jorge Canizales

unread,
Oct 30, 2015, 7:14:54 PM10/30/15
to grpc.io
Ah, excellent! How weird, though. If you're able to reproduce the problem, please let me know, as I'd love to investigate it. But at least you got out of that state.
Reply all
Reply to author
Forward
0 new messages