CocoaPods won't install on device? - ios

So I recently started using CocoaPods and I've gotten a few installed and running without any problems. It works perfectly in the simulator, and if I compile the app to a device through xcode it works fine as well. But when I export the app as an .IPA and install the app on a device my app crashes. The device log states that a library couldn't be loaded. I tried removing the library it could not load, and it proceeded by not being able to load the next library so it seems that the .IPA does not include the CocoaPods at all. I would provide you with my settings in the project file but I don't even know where to start looking or what info to provide you with since I'm very new to CocoaPods.
Here is the error message:
Dyld Error Message:
Library not loaded: #rpath/Charts.framework/Charts
Referenced from: /private/var/mobile/Containers/Bundle/Application/50931ADA-7E77-42C4-BFKA-0EB4A71BCF63/myApp.app/MyApp
Reason: no suitable image found.
Too clarify: It all works fine except when I export the app as an .IPA, so I believe the project hierarchy is correct and the pods are installed correctly. I would bet that there is some sort of project setting that prevents it from being exported?
Edit #1: It works when I export the .IPA without using an Enterprise account, so the issue is somehow connected to the Enterprise account. I read somewhere that the new Cocoa Touch Framework was a bit buggy and couldn't be used with the Enterprise deployment, is CocoaPods using Cocoa Touch Framework? Anyone else have any other suggestions?

Related

Problems loading tdlib on App Store Connect

I ran into a wonderful problem while writing my app in flutter.
I used the tdlib library, which by default for Android is built into flutter, and for the iOS platform it was necessary to compile it via sh script and upload it to App Store Connect with XCFramework, I compiled it, put the folder in the root of the project and the application starts up fine, both from under Android Studio and from under Xcode and works fine in debug mode. But as soon as I upload my application to App Store Connect, Apple starts swearing and saying that my files are not where they should be (namely, dlyb files).
The message from Apple looks like this:
We identified one or more issues with a recent delivery for your app,
"YourAppName" 0.0.22 (47). Please correct the following issues, then
upload again. ITMS-90429: Invalid Swift Support - The files
libswiftDarwin.dylib libswiftMetal.dylib libswiftCoreAudio.dylib
libswiftQuartzCore.dylib libswiftos.dylib libswiftCoreMedia.dylib,
libswiftCore.dylib, libswiftFoundation.dylib, libswiftCoreImage.dylib
aren't at the expected location /Payload/Runner.app/Frameworks. Move
the file to the expected location, rebuild your app using the current
public (GM) version of Xcode, and resubmit it.
I have already tried deleting dlyb files in Runner.app/Frameworks, and moving them, recompiling the .ipa file using various scripts from GitHub, including dlyb files directly, but it doesn't work. The developer wrote in the issue that everything seems to be working (the repository is 8500 commits and is supported to this day), maybe I'm not uploading the application to the App Store correctly? Or did I not connect XCFramework correctly? Maybe someone faced similar?
The XCFramework connection looks like this:

XCode Project Invalid Bundle on App Store Upload

When submitting our app to the app store the validation process for the build keeps getting rejected with the following error.
Invalid Bundle - One or more dynamic libraries that are referenced by your app are not present in the dylib search path.
Has anyone else had issues with this error? I feel like I've tried just about everything. I'd done the suggested otool -L on the main app as well as the watch app. The only library that it shows linked for is the Mixpanel library. The only other two libraries we are using is Fabric and Crashlytics. From my understanding those are not actual real frameworks? I've also tried to set ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES to YES as many posts online suggest. The project builds and runs fine so I'm completely lost as to how to resolve this issue.
This is a React Native iOS app if that has anything to do with it. I'm not the most experience when it comes to iOS stuff but I can find my way around xcode. Anyone have any suggestions? Maybe the best solution is to just create a new xcode project and set everything up again and copy/paste in the code from the previous project?

iOS App Enterprise Deployment: Provisioning Profile for Libraries

We are currently trying to deploy a new version of an iOS Enterprise App via Mobile Device Management after some changes in architecture.
The same app has succesfully been deployed a couple of times in the past, but we recently added a library to the app (in order to reuse some of our code in different places).
The app runs fine when started from Debugger, but crashes immediatly after start when signed and deployed via Mobile Device Management. iOS Crashlog reveals that the library we added does exist but is not loaded.
The error message reads:
Dyld Error Message:
Library not loaded: #rpath/MYAPPLib.framework/MYAPPLib
Referenced from: /private/var/mobile/Containers/Bundle/Application/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/MYAPP_iOS.app/MYAPP_iOS
Reason: no suitable image found. Did find:
/private/var/mobile/Containers/Bundle/Application/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/MYAPP_iOS.app/Frameworks/MYAPPLib.framework/MYAPPLib: mmap() error 1 at address=0xXXXXXXXX, size=0xXXXXXXXX segment=__TEXT in Segment::map() mapping /private/var/mobile/Containers/Bundle/Application/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/MYAPP_iOS.app/Frameworks/MYAPPLib.framework/MYAPPLib
(The bundle identifier and application name have been changed)
We suspect that this might be a signing issue. After archiving the product and exporting ("Save for Enterprise Deployment"), we noticed that no Provisioning Profile is selected for said library (see screenshot below)
Long story short, the question is:
Is it necessary for a library in an iOS App to have a Provisioning Profile? If so, how can I assign one?
All right, so we are still not sure what exactly the problem was. But we can say that the error was resolved by issuing a new developer certificate. So if you are facing the same problem, maybe you want to try this as well.
From the console seems that the app does not find the framework file.
Make sure in your Build Settings you set the Runpath Search Paths to #executable_path/Frameworks
Make sure in Build Phases to have your Framework under Embed Frameworks.
Add your framework under Link Binary With Libraries.
If your framework is developed under same project make sure you make sure you have it under Copy File under Build Phases.

AppCode run iOS simulator "Library not loaded"

I was trying AppCode 3.1. I had a iOS 8.1 project with XCode 6.1.1 with one one linked framework. The framework is SwifteriOS.framework build with Carthage (https://github.com/Carthage/Carthage) like this:
github "mattdonnelly/Swifter" == 1.4.1
Everything in XCode works fine, but when I tried to start the project in simulator with AppCode, the console gives me:
/Users/daiwei/Library/Caches/appCode31/DerivedData/Avetuc-36d98cf8/Build/Products/Debug-iphonesimulator/Avetuc.app
Simulator session started with process 17951
Debugger attached to process 17951
dyld: Library not loaded: #rpath/SwifteriOS.framework/SwifteriOS
Referenced from: /Users/daiwei/Library/Developer/CoreSimulator/Devices/C325D5F4-DDCF-41C5-9F7D-6CC17F175DA4/data/Containers/Bundle/Application/AB30E0FB-7A0F-4914-B6EB-B02B26CB5741/Avetuc.app/Avetuc
Reason: image not found
Exception: EXC_BREAKPOINT (code=EXC_I386_BPT, subcode=0x0))
I can see the simulator launching and showing the launch screen of the app. But app just crash with above message.
image not found usually refers to the framework's binary not being loaded, usually because it's not actually ever copied over to the app's binary.
It could be that Xcode is properly copying over the framework for you, while AppCode doesn't have the instructions to do so. Make sure to follow the Run Script phase instructions (https://github.com/Carthage/Carthage#if-youre-building-for-ios) so that you know for sure that the frameworks will make it over. Also, ensure that the library shows up in "Linked Frameworks and Libraries" as well.

XE4 Deployment error

Good afternoon all. Apologies if SO isn't the place to ask, I wasn't sure there was an 'errors stack exchange' or such, and whether or not any XE4 users would be visitors there.
I'm currently trying out the XE4 trial, and I'm wanting to see just whether the iOS implementation is as easy as they made it look.
I've got my remote profile all setup and working, and I've made a small application that only contains a progress bar. Now, when I deploy that application to the simulator, it runs on the iOS simulator as expected.
However, when I try to deploy to a device, I get the following error;
[DCC Error] E2597 ld: warning: directory not found for option '-FC:\Users\Scott\Documents\RAD Studio\SDKs\iPhoneOS5.0.sdk\System\Library\PrivateFrameworks'
I've tried Debug, Ad-hoc, and App Store profiles, but they all return the same error. The folder 'PrivateFrameworks' doesn't even exist. There's one called 'Frameworks' in the 'Library' folder, but nothing else. I considered that maybe it's an incorrect SDK library path, but the only one with such a path is 'UIFoundation'. Changing the path to 'frameworks' like the others are returns this;
[DCC Error] E2597 ld: warning: can't parse __DATA/__objc_imageinfo section in C:\Users\Scott\Documents\RAD Studio\SDKs\iPhoneOS5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
That file DOES exist (99KB) but the error remains (and so I assume that changing the SDK lib path wasn't the right thing to do). It's like it's not even attempting to deploy over to the mac for compilation due to a file or folder issue.
Any ideas?
You could look at the checklist in the Troubleshooting: Cannot Deploy to the iOS Device help topic.
If you have not run your iOS app on the iOS Simulator, make sure you satisfy the requirements here:
Troubleshooting: Cannot Deploy to the iOS Simulator
Make sure your iOS device is connected to your Mac by USB cable.
Specify the iOS Device as the target platform in the Project Manager.
Complete the Provisioning page. (Your developer certificate is required for code signing)
Set the required Project Options for your iOS app:
Specify your application icons - Application Options.
Specify info.plist keys such as UIDeviceFamily - Version Info.
Install the Xcode command-line tools on your Mac. (Required for code signing your iOS app)
There are links in the documentation above with details about some of the steps involved.
I had extactly the same issue. It happened when trtying to deploy to the iOS 5.0 simulator (not even an iOS device).
It appears that UIFoundations (PrivateFrameworks) gets pulled across and cached when you setup the SDK for iOS 6.1 on XE4.
Make sure the sumulators are installed on Xcode in preferences. Restart Xcode (make sure the PA server is running). Setup a connection profile with the 6.1 SDK in options on XE4 and it works.
Hope this makes sense but it solved my issue.
Add the missing framework into your SDK. Tools->Options->SDK Manager, go to Frameworks and click the yellow button. Also remember to press "Update Local File Cache" after you're done. You will find that you will need to fetch more Frameworks and Libraries in the future.

Resources