1

Can't Build iOS NotificationService Sample

asked 2015-06-05 21:58:54 -0700

John_Brewer gravatar image

updated 2015-06-10 17:18:03 -0700

Mac OS X 10.10.3, Xcode 6.3.2 (6D2105)

Steps to reproduce:

  1. Build AllJoyn Core for iOS using instructions at: https://allseenalliance.org/developers/develop/building/ios-osx/build-source (specifically the command line build section.)

  2. Clone the services repo via git clone https://git.allseenalliance.org/gerrit/services/base.git (NOT https://git.allseenalliance.org/gerrit/services/notification.git WHICH LOOKS LEGIT BUT HASN'T BEEN UPDATED IN OVER A YEAR!)

  3. Ensure that the environment variables ALLJOYN_SDK_ROOT, OPENSSL_ROOT, and ALLSEEN_BASE_SERVICES_ROOT are correctly set via launchctl.

  4. Kill Finder and Xcode so environment variables update inside Xcode.

  5. Open Xcode workspace: $(ALLSEEN_BASE_SERVICES_ROOT)/notification/ios/NotificationServiceWorkspace.xcworkspace

  6. Choose "Run" from the "Product Menu". At this point I'd expect the app to build and run. Instead, I get a lot of missing library errors for various services the NotificationService app depends on. So...

  7. Go and manually build all the dependencies from the workspace. At this point you get link errors for the about service, so....

  8. Go back and manually build alljoyn_about_cpp and alljoyn_about_objc from core.

  9. At this point, I end up with a WHOLE BUNCH of link errors and warnings. Here are the first few:

ld: warning: directory not found for option '-L/proj/allseen-06-04/alljoyn/build/darwin/arm64/iphoneos/Debug/dist/about/lib' ld: warning: directory not found for option '-L/proj/allseen-06-04/base/notification/ios/samples/NotificationService/../alljoyn_services_cpp/build/Debug-iphoneos' ld: warning: directory not found for option '-L/proj/allseen-06-04/base/notification/ios/samples/NotificationService/../alljoyn_services_objc/build/Debug-iphoneos' ld: warning: directory not found for option '-L/proj/allseen-06-04/base/notification/ios/samples/NotificationService/../../../../services_common/ios/samples/alljoyn_services_cpp/build/Debug-iphoneos' ld: warning: directory not found for option '-L/proj/allseen-06-04/base/notification/ios/samples/NotificationService/../../../../services_common/ios/samples/alljoyn_services_objc/build/Debug-iphoneos' ld: warning: directory not found for option '-L/proj/allseen-06-04/base/notification/ios/samples/NotificationService/../../../../controlpanel/ios/samples/alljoyn_services_cpp/build/Debug-iphoneos' ld: warning: directory not found for option '-L/proj/allseen-06-04/base/notification/ios/samples/NotificationService/../../../../controlpanel/ios/samples/alljoyn_services_objc/build/Debug-iphoneos' ld: warning: ignoring file /proj/allseen-06-04/alljoyn/build/darwin/arm/iphoneos/Debug/dist/cpp/lib/libajrouter.a, file was built for archive which is not the architecture being linked (arm64): /proj/allseen-06-04/alljoyn/build/darwin/arm/iphoneos/Debug/dist/cpp/lib/libajrouter.ald: warning: ld: warning: ignoring file /proj/allseen-06-04/alljoyn/build/darwin/arm/iphoneos/Debug/dist/cpp/lib/liballjoyn.a, file was built for archive which is not the architecture being linked (arm64): /proj/allseen-06-04/alljoyn/build/darwin/arm/iphoneos/Debug/dist/cpp/lib/liballjoyn.ald: warning: ignoring file /proj/alljoyn-ssl/openssl/build/Debug-iphoneos/libssl.a, missing required architecture arm64 in file /proj/alljoyn-ssl/openssl/build/Debug-iphoneos/libssl.a (2 slices) ignoring file /proj/alljoyn-ssl/openssl/build/Debug-iphoneos/libcrypto.a, missing required architecture arm64 in file /proj/alljoyn-ssl/openssl/build/Debug-iphoneos/libcrypto.a (2 slices)

Undefined symbols for architecture arm64: "ajn::BusAttachment::UnregisterSignalHandler(ajn::MessageReceiver, void (ajn::MessageReceiver::)(ajn::InterfaceDescription::Member const, char const, qcc::ManagedObj<ajn::_message>&), ajn::InterfaceDescription::Member const, char const)", referenced from: ajn::services ... (more)

edit retag flag offensive close merge delete

Comments

I went back and swapped out my built-from-tree version of the AllJoyn core with the version from: https://allseenalliance.org/releases/alljoyn/15.04/alljoyn-15.04.00-osx_ios-sdk.zip I'm still getting the same errors and warnings. What now?

John_Brewer ( 2015-06-05 22:49:08 -0700 )edit

Can you post the header and library search paths you're using in your project file?

pbergson ( 2015-06-10 12:33:24 -0700 )edit

I'm using the search paths as found in the project in the repo. I've copied and pasted them into the question above.

John_Brewer ( 2015-06-10 17:18:37 -0700 )edit

the core working group is looking for people to maintain iOS/OSX bindings, SDKs, and documentation, if you're interested in helping.

ry.jones ( 2015-06-18 11:51:17 -0700 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-06-11 09:40:07 -0700

pbergson gravatar image

I think the library search paths provided in the instructions aren't quite correct. The libraries found in the "about" directories are only generated by a script that puts everything in "arm". So this search path:

$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/about/lib

will try to find a directory called build/darwin/arm64/iphoneos/debug/dist/about/lib, which doesn't exist. That explains some of the warnings, and I would remove that path. The only path that works is the one above, which hardcodes 'arm':

$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/about/lib

(or i386 if you're running on the simulator). Fortunately, the library here is fat - armv7 and arm64.

Your second problem is that while you do need the arm/iphoneos/debug/dist/about directory, you can't use the libraries found in arm/iphoneos/debug/dist/cpp/lib, as they are not fat, but only armv7. So I bet if you remove this search path:

$(ALLJOYN_SDK_ROOT)/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/lib

you'll be able to build arm64 from the correct path:

$(ALLJOYN_SDK_ROOT)/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/lib

I'm building a different project, so I can't comment on the service errors, but if this doesn't help you out, I'll take a look.

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2015-06-05 21:58:54 -0700

Seen: 21,732 times

Last updated: Jun 11 '15