Help resolving build errors data-collection-ios GitHub sample

944
4
Jump to solution
04-05-2019 02:18 PM
JohnMDye
Regular Contributor

So, complete noob here, just getting into iOS development. I cloned the GitHub - Esri/data-collection-ios: Mobile data collection app using the iOS Runtime SDK repo and am trying to get it up and running. I haven't made any changes other than updating some of the project properties to use my own developer provisioning file and renaming the bundle identifier.

I created an ArcGIS Developer account and downloaded and installed the ArcGIS Runtime SDK for iOS, version 100.4.0 on my Mac running OSX 10.4.13 with Xcode 10.2. I did a manual install, not cocoapods but left all of the settings at their default from the installer.

I thought it'd be pretty simple but I ran into a couple of build errors which I don't know how to resolve.

1. Multiple commands produce '/Users/jmdye/Library/Developer/Xcode/DerivedData/data-collection-ecahnpmltmvztsbgvwhtlgnntjdm/Build/Products/Debug-iphoneos/data-collection.app/ArcGIS.bundle':
1) Target 'data-collection' (project 'data-collection') has copy command from '/Users/jmdye/Git/data-collection-ios/data-collection/ArcGIS.bundle' to '/Users/jmdye/Library/Developer/Xcode/DerivedData/data-collection-ecahnpmltmvztsbgvwhtlgnntjdm/Build/Products/Debug-iphoneos/data-collection.app/ArcGIS.bundle'
2) Target 'data-collection' (project 'data-collection') has copy command from '/Users/jmdye/Library/SDKs/ArcGIS/iOS/Frameworks/Static/ArcGIS.framework/Versions/Current/Resources/ArcGIS.bundle' to '/Users/jmdye/Library/Developer/Xcode/DerivedData/data-collection-ecahnpmltmvztsbgvwhtlgnntjdm/Build/Products/Debug-iphoneos/data-collection.app/ArcGIS.bundle'

2.  /Users/jmdye/Git/data-collection-ios/data-collection/data-collection/View Controllers/App Container/AppContainerViewController+DrawerDelegate.swift:16:8: No such module 'ArcGIS'

I assumed the second error might be caused by the ArcGIS resource bundle not being added to the project. So I did that, following the instructions outlined here, but it didn't resolve the error. I checked all the other project settings and made sure that framework search paths, build flags and link dependencies were established as described in the install guide for the runtime SDK, they all appear fine to me.

0 Kudos
1 Solution

Accepted Solutions
EliGregory
Esri Contributor

Hi John, i'd be happy to help you troubleshoot.

It appears there might be a few issues with your Xcode project configuration. We can try a few techniques to get you up and running. Before we do this, ensure you have installed the latest version of the ArcGIS Runtime SDK and you're running the latest version of Xcode.

I'll offer a few approaches, feel free to choose the approach that works best for you.

Approach 1. Double check references to the Framework and Bundle

There are two ArcGIS resources needed to compile and run the app. They are the ArcGIS.framework and the ArcGIS.bundle.

First let's ensure the ArcGIS.bundle is referenced by the project only one place. The error that reads starting with "Multiple commands produce ..." leads me to believe the project is attempting to build with two references to the ArcGIS.bundle. What we need to do is to delete the second reference. The application in its current condition is configured to reference the ArcGIS.bundle from within the 'Resources' folder. Based on this path in the error ('/Users/jmdye/Git/data-collection-ios/data-collection/ArcGIS.bundle') it appears you might have added a second reference to the ArcGIS.bundle located in the top level project folder? If this is the case, i'll ask you to delete this reference. When deleting this reference, be sure to select the 'Remove Reference' option when prompted.

Next, the's ensure the ArcGIS.framework can be found on your machine where the Xcode project thinks it should be. The project finds the ArcGIS.framework by following the path specified in the target's Framework Search Paths. We want to ensure the Framework Search Path matches where the framework is installed on your machine. Following these steps (numbers correspond to the screen grab beneath):

  1. Select the project
  2. Select the target 'data-collection'
  3. Select the 'Build Settings' pane
  4. Filter down the fields using the search bar, typing: "Framework Search Paths"

steps

 

It is at this path where Xcode will look for the ArcGIS.framework. Can you confirm that the framework exists at this path on your machine? The path used in the Data Collection project is the default install location specified by the Installer. If you have installed the framework to a different path, update the above "Framework Search Paths" value to the path to the directory that contains the ArcGIS.framework.

Now, try to Build & Run. Were you successful?

Approach 2. Build project using the Dynamic Framework

To follow this approach, you will need to first remove references the static framework before adding references to the dynamic.

Remove Reference to Static Framework

Following the steps outlined in the above approach 1 that demonstrates how to find the Framework Search Paths, delete the value found for Framework Search Paths. Next, delete all references to the ArcGIS.bundle within your project.

Add Reference to Dynamic Framework

1. With the project selected, under the General tab scroll down to the 'Embedded Binaries' section. Click the '+' button located in the bottom left corner of the view.
2. Click 'Add Other...'
3. Select framework following the path: `/Users/<your-username>/Library/SDKs/ArcGIS/iOS/Frameworks/Dynamic/ArcGIS.framework`
4. Ensure 'Copy items if needed' is **not** selected

Note* If you don't see Library in your home folder, you can follow these instructions to toggle the folder visibility.

1. In Finder, click your home folder
2. Click the 'View' menu and select 'Show View Options'
3. Ensure 'Show Library Folder' is enabled

Now, try to Build & Run. Were you successful?

Approach 3. Clean Re-Start

You can always try restarting the whole process by deleting the project and cloning the github project again. If you choose to try this route, I encourage you to attempt to build and run the project immediately after cloning the new project and before you begin provisioning the project and configuring the app.

Were you successful?

Success?

Did any of these three approaches help you? I'd be happy to help you troubleshoot further, if needed.

A Heads Up!

In only a matter of days we will be releasing Data Collection v1.1. Because we're operating in open source, you can see a pre-release version of the v1.1 app on the repo's v.next branch. If you're interesting in building your own ArcGIS data collection solution using this app, I encourage you to use the nearly release v1.1.

And as always, feedback is welcomed.

View solution in original post

4 Replies
JohnMDye
Regular Contributor

First let's ensure the ArcGIS.bundle is referenced by the project only one place. The error that reads starting with "Multiple commands produce ..." leads me to believe the project is attempting to build with two references to the ArcGIS.bundle. What we need to do is to delete the second reference. The application in its current condition is configured to reference the ArcGIS.bundle from within the 'Resources' folder. Based on this path in the error ('/Users/jmdye/Git/data-collection-ios/data-collection/ArcGIS.bundle') it appears you might have added a second reference to the ArcGIS.bundle located in the top level project folder? If this is the case, i'll ask you to delete this reference.

Bingo. This Stack Overflow response to a similar error tipped me off, but your response is spot on and it comes with an explanation! Even though I'd corrected this issue, I didn't understand what was wrong in the first place, so thank for taking the time to write out those detailed troubleshooting steps, super helpful!

0 Kudos
EliGregory
Esri Contributor

I'm glad the issue is resolved. You can ignore the troubleshooting response i've offered below but I do think it's still worth noting the following bit:

A Heads Up!

 

In only a matter of days we will be releasing Data Collection v1.1. Because we're operating in open source, you can see a pre-release version of the v1.1 app on the repo's v.nextbranch. If you're interesting in building your own ArcGIS data collection solution using this app, I encourage you to use the nearly release v1.1.

 

And as always, feedback is welcomed.

JohnMDye
Regular Contributor

I'm actually just tinkering around. I just finished the SalesForce iOS Development Trail and wanted something to play with. I'll definitely fetch from the repo once 1.1 is merged into master. For now, I'll keep toying with the current version since I'm not doing anything serious. Much appreciated heads up!

0 Kudos
EliGregory
Esri Contributor

Hi John, i'd be happy to help you troubleshoot.

It appears there might be a few issues with your Xcode project configuration. We can try a few techniques to get you up and running. Before we do this, ensure you have installed the latest version of the ArcGIS Runtime SDK and you're running the latest version of Xcode.

I'll offer a few approaches, feel free to choose the approach that works best for you.

Approach 1. Double check references to the Framework and Bundle

There are two ArcGIS resources needed to compile and run the app. They are the ArcGIS.framework and the ArcGIS.bundle.

First let's ensure the ArcGIS.bundle is referenced by the project only one place. The error that reads starting with "Multiple commands produce ..." leads me to believe the project is attempting to build with two references to the ArcGIS.bundle. What we need to do is to delete the second reference. The application in its current condition is configured to reference the ArcGIS.bundle from within the 'Resources' folder. Based on this path in the error ('/Users/jmdye/Git/data-collection-ios/data-collection/ArcGIS.bundle') it appears you might have added a second reference to the ArcGIS.bundle located in the top level project folder? If this is the case, i'll ask you to delete this reference. When deleting this reference, be sure to select the 'Remove Reference' option when prompted.

Next, the's ensure the ArcGIS.framework can be found on your machine where the Xcode project thinks it should be. The project finds the ArcGIS.framework by following the path specified in the target's Framework Search Paths. We want to ensure the Framework Search Path matches where the framework is installed on your machine. Following these steps (numbers correspond to the screen grab beneath):

  1. Select the project
  2. Select the target 'data-collection'
  3. Select the 'Build Settings' pane
  4. Filter down the fields using the search bar, typing: "Framework Search Paths"

steps

 

It is at this path where Xcode will look for the ArcGIS.framework. Can you confirm that the framework exists at this path on your machine? The path used in the Data Collection project is the default install location specified by the Installer. If you have installed the framework to a different path, update the above "Framework Search Paths" value to the path to the directory that contains the ArcGIS.framework.

Now, try to Build & Run. Were you successful?

Approach 2. Build project using the Dynamic Framework

To follow this approach, you will need to first remove references the static framework before adding references to the dynamic.

Remove Reference to Static Framework

Following the steps outlined in the above approach 1 that demonstrates how to find the Framework Search Paths, delete the value found for Framework Search Paths. Next, delete all references to the ArcGIS.bundle within your project.

Add Reference to Dynamic Framework

1. With the project selected, under the General tab scroll down to the 'Embedded Binaries' section. Click the '+' button located in the bottom left corner of the view.
2. Click 'Add Other...'
3. Select framework following the path: `/Users/<your-username>/Library/SDKs/ArcGIS/iOS/Frameworks/Dynamic/ArcGIS.framework`
4. Ensure 'Copy items if needed' is **not** selected

Note* If you don't see Library in your home folder, you can follow these instructions to toggle the folder visibility.

1. In Finder, click your home folder
2. Click the 'View' menu and select 'Show View Options'
3. Ensure 'Show Library Folder' is enabled

Now, try to Build & Run. Were you successful?

Approach 3. Clean Re-Start

You can always try restarting the whole process by deleting the project and cloning the github project again. If you choose to try this route, I encourage you to attempt to build and run the project immediately after cloning the new project and before you begin provisioning the project and configuring the app.

Were you successful?

Success?

Did any of these three approaches help you? I'd be happy to help you troubleshoot further, if needed.

A Heads Up!

In only a matter of days we will be releasing Data Collection v1.1. Because we're operating in open source, you can see a pre-release version of the v1.1 app on the repo's v.next branch. If you're interesting in building your own ArcGIS data collection solution using this app, I encourage you to use the nearly release v1.1.

And as always, feedback is welcomed.

View solution in original post