cancel
Showing results for 
Search instead for 
Did you mean: 

Errors while Setup Xcode project manually with ArcGIS framework

Former Member
0 Kudos

Hi,

I am building up the Xcode project manually to develop Agentry application.

Basically I am following below steps, my development Mac is Yosemite with Xcode 6.1.1 installed.

The detailed procedure -

Part 1. Create New Project and Including AgentryClient Framework

Pre-requisites:

  • A Mac OX Yosemite with Xcode 6.1.1 installed and ready to develop for iOS.
  • The SMPAgentryClientFramework distribution has been expanded into a directory. For the rest of these instructions, we are assuming this was done to the SDK_INSTALL_HOME directory.

Instructions: (Sorry for the mess index)

  1. Open Xcode and create a new project. Choose Xcode Menu File->New->Project->iOS->Single View Application.
  2. Set the iOS Deployment Target to 7.0 or above for your project.
  3. Set the Architectures and Valid Architectures build settings to other as $(ARCHS_STANDARD_32_BIT) for your project. (Xcode 6.1 defaults to including arm64 as a standard architecture, but that is not supported by Agentry).
  4. Add the SAP Mobile Platform Agentry Client Framework:
    1. Select the project, the main target, and in Build Settings search for "Framework Search Path"
    2. Double click and enter: $(HOME)/SAP/MobileSDK3/SMPAgentryClientFramework/iOS/**
  5. Add the SAP Mobile Platform Agentry Client Framework Headers:
    1. Select the project, the main target, and in Build Settings search for "Header Search Path"
    2. Double click and enter:$(HOME)/SAP/MobileSDK3/SMPAgentryClientFramework/iOS/SMPAgentryClient.framework/Headers/**
  6. Modify linker flags:
    1. Select the project, the main target, and in Build Settings search for "Other Linker Flags"
    2. Double click and enter: -ObjC -framework SMPAgentryClient
  7. Add the required dynamic libraries and frameworks:
    1. Select the project, the main target, and in Build Phases search select the "Link With Dynamic Libraries" section.
    2. Click on the "+" button, and add the following:
      • libc++.dylib
      • libiconv.dylib
      • libicucore.dylib
      • libxml2.dylib
      • AudioToolbox.framework
      • AVFoundation.framework
      • CFNetwork.framework
      • CoreLocation.framework
      • CoreMedia.framework
      • CoreText.framework
      • CoreVideo.framework
      • QuartzCore.framework
      • Security.framework
      • CoreGraphics.framework
      • Foundation.framework
      • UIKit.framework
  8. Remove stripping from the project settings:
    1. Select the project, the Xcode project, and in Build Settings search for "Strip Linked Product"
    2. Double click and select No.
  9. Add the resources bundle:
    1. Go to the Xcode application File menu
    2. Select the Add Files to Project item
    3. Browse to the SDK_INSTALL_HOME/SMPAgentryClientFramework/iOS/SMPAgentryClient.framework/Resources/SMPAgentryClientResource.bundle location, and add it.
  10. Modify the main.m file to launch the Agentry Client:
    1. Replace the app delegate class name with the string @"SMPAgentryClientAppDelegate".
    2. Replace the application class name with the string @"SMPAgentryApplication".
    3. At the end, the return statement should look like this: return UIApplicationMain(argc, argv, @"SMPAgentryApplication", @"SMPAgentryClientAppDelegate");
  11. Set up the app so that view controllers do not determine the style of the status bar.
    1. Modify Info.plist to inclide the following key: UIViewControllerBasedStatusBarAppearance set to false.
  12. Click Project in Navigation -> Targets ->Delete Target for SMPAgentrySampleTest, to make sure don’t have compile error from test target
  13. Build and launch and the default Agentry Client should come up in the simulator or device.


Till now, the application works fine after launch in simulator and device, I can see the SMP Agentry Client login screen. But some error happened after i continue the following steps to integrate GIS framework


Part 2. Setup Xcode with ArcGIS runtime SDK

Pre-requisites:

  1) Download ArcGIS framework (AGSRuntimeSDKiOSv10.1.1.pkg & AGSRuntimeSDKiOSv10.1.1-u2.pkg) from site       http://www.esri.com/apps/products/download/

  2)Double click to Install AGSRuntimeSDKiOSv10.1.1.pkg firstly, then AGSRuntimeSDKiOSv10.1.1-u2.pkg, after install success, will see ArcGIS folder in MAC_HOME_DIR/Library/SDKs/ArcGIS/iOS

Precedure:

  1. I don't try Cocoapods here. I followed the section 'Setup Your Xcode Project Manually' in below link

https://developers.arcgis.com/ios/objective-c/guide/install.htm

  2. From Xcode building Setting, set Other Linker Flags as -ObjC -framework SMPAgentryClient -framework ArcGIS -l c++  , but compile with error as below -

Undefined symbols for architecture armv7:

  "_SCNetworkReachabilityScheduleWithRunLoop", referenced from:

      -[Reachability startNotifier] in Common(Common)

  "_OBJC_CLASS_$_AGSGDBGenerateParameters", referenced from:

      objc-class-ref in GIS(GIS)

  "_SCNetworkReachabilityCreateWithName", referenced from:

      +[Reachability reachabilityWithHostName:] in Common(Common)

  "_OBJC_CLASS_$_AGSFeatureTableLayer", referenced from:

      objc-class-ref in GIS(GIS)

  "_OBJC_CLASS_$_AGSGDBGeodatabase", referenced from:

      objc-class-ref in GIS(GIS)

  "_SCNetworkReachabilityCreateWithAddress", referenced from:

      +[Reachability reachabilityWithAddress:] in Common(Common)

  "_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from:

      -[Reachability stopNotifier] in Common(Common)

  "_OBJC_CLASS_$_AGSGDBSyncTask", referenced from:

As suggested by the this post(ios - Undefined symbols for architecture armv7 - Stack Overflow), I remove '-ObjC' in Building Setting/Other Linker Flags and set as -framework SMPAgentryClient -framework ArcGIS -l c++ , then compile success but run app in Xcode with another exception -


2015-01-15 15:07:50.279 SMPAgentrySample[979:619589] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unable to instantiate the UIApplication subclass instance. No class named SMPAgentryApplication is loaded.'

*** First throw call stack:

(0x2323f49f 0x30cc7c8b 0x2323f375 0x23f10ddb 0x26760c23 0xd2001 0x31247aaf)

libc++abi.dylib: terminating with uncaught exception of type NSException


So basically the application is not able to understand SMPAgentryApplication, I think need to import the static library SMPAgentryClient correctly into Xcode.


The issue 'Undefined symbols for architecture armv7:' is happening after add the two framework(Common.framework and GIS.framework which both from post , Called 'SAP EAM and Service Mobile App SDK') into Build Phases/Link Library with Libraries, Can anyone help to check any dependent libraries need to be added for these framework?


Can anyone help me out from these issues?  Any suggestion will be highly appreciated!

Message was edited by: Aaron Hu

Accepted Solutions (1)

Accepted Solutions (1)

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

Aaron,

Please make sure you are following the SAP EAM and Service Mobile App SDK installation guide for the step by step process.  In particular you for iOS you need to be using ArcGIS SDK version 10.2.3 and not the 10.2.2 or 10.1.1 I see referenced in your post.

Rather than build my Agentry client from scratch I typically start with the SMPAgentryClientFrameworkSetup project that is part of the OpenUI SDK to make the base client setup easier.   I then follow the instructions for the GIS client to add in the rest of the pieces.

Please retry following those instructions and if you are still having problems let us know.

--Bill

Former Member
0 Kudos

Hi Bill,

Thanks so much for your reply!

I tried both CocoaPods and Manually setup Xcode.

For CocoaPods, it automatically grab the latest ArcGIS-Runtime-SDK-iOS (10.2.4) from repository, do you think any problem with this version?

For mannually setup, I was downloading the ArcGIS SDK from Esri Downloads

But can not see the version 10.2.3, So I tried 10.1.1 and it's Update2.

ArcGIS Runtime SDK for iOS

Software
ArcGIS Runtime SDK for iOS v10.1.1AGSRuntimeSDKiOSv10.1.1.pkg
ArcGIS Runtime SDK for iOS v10.1.1 Update 1AGSRuntimeSDKiOSv10.1.1-u1.pkg
ArcGIS Runtime SDK for iOS v10.1.1 Update 2AGSRuntimeSDKiOSv10.1.1-u2.pkg
ArcGIS Runtime SDK for iOS v2.0.1AGSAPIiOSV201.pkg
ArcGIS Runtime SDK for iOS v2.1AGSAPIiOSv21.pkg
ArcGIS Runtime SDK for iOS v2.2.1AGSRuntimeSDKiOSv2.2.1.pkg
ArcGIS Runtime SDK for iOS v2.3AGSRuntimeSDKiOSv2.3.pkg
ArcGIS Runtime SDK for iOS v2.3.2AGSRuntimeSDKiOSv2.3.2.pkg

Thanks for your time!

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

I did not use CocoaPods but instead downloaded the 10.2.3 version.  It should work with the 10.2.4 but hasn't been tested as the control was developed using 10.2.3.

I am not sure where the 10.2.3 version went.  I just tried to download and it doesn't show as available.  I would go with 10.2.4 in this case then.

--Bill

Former Member
0 Kudos

Thanks Bill.

Issue resolved!

Attach below comment in case anyone needed.

Compared with previous process in original post, I made below changes-

1. Download the latest ArcGIS Runtime SDK for iOS 10.2.4 and install

2. The value of Xcode/Build Setting/Other Linker Flags should be set as “–ObjC –framework SMPAgentryClient –framework ArcGIS –l c++”(No double quotes)

3. Adding SystemConfigure.framework in Xcode/Build Phases/Link Binary with Libraries, to make sure work fine with Reachability

I tried build up the project from scratch and based on SMPAgentryClientFrameworkSetup. both work well.

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

Glad you got it working!  Please mark the question as answered so others will know you have it working.

--Bill

Answers (0)