Hi Developers,
I am working on a Nativescript app and using Pod to install ArcGIS-Runtime-SDK-iOS 100.15.0. The app is crashing on startup with the following error
dyld[63852]: Library not loaded: @rpath/ArcGIS.framework/ArcGIS
Referenced from: <441D18D8-E854-35C7-B7DF-7F4AB9A6DB22> /Users/i858674/Library/Developer/CoreSimulator/Devices/86E443B4-78F1-4EA9-8E51-94BFB8C758FE/data/Containers/Bundle/Application/636D3ABE-A9FB-4D63-9EDD-77E6B0CA1828/MYCocoaPodsApp.app/MYCocoaPodsApp
Reason: tried: '/Users/i858674/Library/Developer/Xcode/DerivedData/MYCocoaPodsApp-dxjphztxjvloanbvbmyixisilady/Build/Products/Debug-iphonesimulator/ArcGIS.framework/ArcGIS' (errno=2), '/Users/i858674/Library/Developer/CoreSimulator/Devices/86E443B4-78F1-4EA9-8E51-94BFB8C758FE/data/Containers/Bundle/Application/636D3ABE-A9FB-4D63-9EDD-77E6B0CA1828/MYCocoaPodsApp.app/Frameworks/ArcGIS.framework/ArcGIS' (errno=2), '/Users/i858674/Library/Developer/CoreSimulator/Devices/86E443B4-78F1-4EA9-8E51-94BFB8C758FE/data/Containers/Bundle/Application/636D3ABE-A9FB-4D63-9EDD-77E6B0CA1828/MYCocoaPodsApp.app/Frameworks/ArcGIS.framework/ArcGIS' (errno=2), '/Users/i858674/Library/Developer/CoreSimulator/Devices/86E443B4-78F1-4EA9-8E51-94BFB8C758FE/data/Containers/Bundle/Application/636D3ABE-A9FB-4D63-9EDD-77E6B0CA1828/MYCocoaPodsApp.app/Frameworks/ArcGIS.framework/ArcGIS' (errno=2), '/Users/i858674/Library/Developer/CoreSimulator/Devices/86E443B4-78F1-4EA9-8E51-94BFB8C758FE/data/Containers/Bundle/Application/636D3ABE-A9FB-4D63-9EDD-77E6B0CA1828/MYCocoaPodsApp.app/Frameworks/ArcGIS.framework/ArcGIS' (errno=2), '/Users/i858674/Library/Developer/CoreSimulator/Devices/86E443B4-78F1-4EA9-8E51-94BFB8C758FE/data/Containers/Bundle/Application/636D3ABE-A9FB-4D63-9EDD-77E6B0CA1828/MYCocoaPodsApp.app/Frameworks/ArcGIS.framework/ArcGIS' (errno=2), '/Users/i858674/Library/Developer/CoreSimulator/Devices/86E443B4-78F1-4EA9-8E51-94BFB8C758FE/data/Containers/Bundle/Application/636D3ABE-A9FB-4D63-9EDD-77E6B0CA1828/MYCocoaPodsApp.app/Frameworks/ArcGIS.framework/ArcGIS' (errno=2), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/ArcGIS.framework/ArcGIS' (errno=2)
The pod file looks like the following
pod 'ArcGIS-Runtime-SDK-iOS', '100.15.0'
I could not reproduce this issue in the 100.14 version so it seems like something was changed between 100.14.vs 100.15 on how the framework is built.
I checked the directory ArcGIS.framework/ArcGIS directory and in both 100.14 and 100.15, it is empty under the Derived Data so I am not suspecting that's the root cause of this issue. I believe somehow the way the framework is shipped in 100.15 is causing the issue.
If I look under SampleApp.app/Frameworks/ I don't find any ArcGIS framework.
Any help or pointers to resolve this issue would be highly appreciated.
Can you try to create a new project and import ArcGIS Runtime using CocoaPods? According to our testing it worked when we released 100.15.0, and we didn't make any change that would affect pods install.
Alternatively, if it is suitable for your project to use Swift Package Manager, follow the instructions in https://developers.arcgis.com/ios/install-and-set-up/#swift-package-manager to set it up. It is simpler than pods and is currently the preferred dependency management method for Apple development.
Hey Ting,
Thank you for the reply. I just created a sample iOS project with the following Podfile
platform :ios, '14.0'
target 'ArcGISSample' do
use_frameworks!
pod 'ArcGIS-Runtime-SDK-iOS', '100.15.0'
end
and faced the same issue. The sample project is attached. Can you take a look and see if you can reproduce this? My pod version is 1.11.3
I also noticed that when running the pod install command, the XCode creates the [CP] Embed Pods Frameworks step. One of the other developers who can't reproduce the issue has the step to copy the ArcGIS.framework to the appropriate folder which I find missing in my installation. Attached is the screenshot of how the Embed Pod Framework step looks like where the issue is not reproducible.
It is not consistently reproducible by every developer and only some of them are having the issue and we fail to find the root cause of it.
I downloaded your project, and run `pod install --repo-update` before opened the `ArcGISSample.xcworkspace` file. Then I added a map view to the project, and it builds and runs.
Attached is a screenshot of the project. Can you find anything helpful to you?
I'm also using CocoaPods version 1.11.3. I changed your project file format to Xcode 13.0-compatible and also lowered the target to iOS 14.0, in order to verify ArcGIS 100.15.0 still works on older version. All seems to be fine for me. 🤔
pod install should be hassle-free and I don't think there is additional step required for you to build the project. Do you have any other script or build phases that might effect the project?
Also, make sure your local pods cache are correct. I have a feeling that it might be corrupted which made you cannot build the attached project.
I did remove the local pod cache and faced the same issue in the sample project. There is no build script involved in the sample project. I am just doing pod-install and running the xcworkspace file and it crashes before the launch. Can you share the Pods-ArcGISSample-frameworks.sh file that is generated by the Pod under Pods/Target Support Files/Pods-ArcGISSample. I want to compare if the generated pod is created the same framework.sh file to copy the framework to relevant directory. Attached is mine and let me know if you see any differences?
Compared yours with mine, the obvious difference I see is near the end of the script. It seems yours don't have the lines that install ArcGIS.framework . See attached zip.
To me it sounds more likely that your local CocoaPods configuration has some problem. 😔
Do you see any error or warnings when you install the pod?
I'm afraid I only have some other general thoughts. 😥
- Cleaning
First try to clear the pods, pod cache clean --all
Then try to clean the derived data and the app build data
Then try to reset the pods integration from the project, pod deintegrate, then start from scratch
Finally, try to manually clear the pods directories, ${HOME}/Library/Caches/CocoaPods and ./Pods
- Try embed and sign
Sometimes this helps, but I don't think it should in this case.
- Try again with 100.14.0 and older versions using a new project. It should work for all versions.
- Make sure CocoaPods is up to date. Sometimes there might be multiple versions of it on a machine.
- Try Swift Package Manager - it is the easiest way to integrate a package nowadays.
Same issue,
upgrading pod from 100.14 to 100.15 :
Reason: tried: '/usr/lib/swift/ArcGIS.framework/ArcGIS' (errno=2, not in dyld cache),
-> crash at runtime