iOS - Framework files showing when app crashes from integrated base project - ios

I have created a framework and integrated into the base project for execution case my framework implementation may miss out like:
array out of bounds error
null pointer exception
For this type of scenarios, the app crashed due to the above exception (test.framework) at the same time framework implementation files showing only when the app crashed.
Please let me know if there is a way to fix it?
Reference : https://instabug.com/blog/ios-binary-framework/

Your framework contains debug information which includes file locations.
Since you are using the same machine, lldb debugger is able to locate the source code where your app crashed.
You can move the Framework's Xcode project to different location on your Mac to see the difference.

Related

iOS Embedded Framework with Embedded Framework

I'm working on a framework which embeds another framework (from CocoaPods) for error logging on iOS. This is working very well, and I can embed such a framework in an iOS application for testing, codesign everything, and debug on my own device easily. Unfortunately, when attempting to upload such an application to Apple for distribution, I get an error message as such:
Invalid Bundle. The bundle at '<myapp>.app/Frameworks/<myframework>.framework' contains disallowed file 'Frameworks'. With error code STATE_ERROR.VALIDATION_ERROR.90206 for id ***
I'm not sure if this message indicates that I'm not allowed to embed a framework in another framework or what. It seems the automatic codesigning Xcode is doing is not recursing to the deepest embedded framework upload (I have a script to manually sign everything on build). Does anyone have experience with an error like this or know where to look? It seems others have asked questions about embedding frameworks in other frameworks before, but most of these are how to get linking to work or how to properly reference these nested frameworks. My issue is specifically if I am allowed to upload such things to test flight/the app store, and how to do so if it is possible. Most people having this issue seem to have disabled swift support, but none of the projects I'm using have swift code.
Nested bundle cannot include a framework. You can check this apple document.
iOS and tvOS support frameworks and Swift system libraries at the topmost app level; a nested bundle, like an app extension, can’t include a framework.
And there is a warning block that worth being noticed:
If you put content in the wrong location, you may encounter hard-to-debug code signing and distribution problems. These problems aren’t always immediately obvious. For example, when building a Mac app, incorrectly placed code might work during day-to-day development, but might cause problems during notarization.
So that is the reason everything seems normal while running in debug mode but failed at distribution.

New to Firebase and swift. Having trouble connecting Firebase to Xcode

So I am new to swift and xcode so please have mercy. So basically I am trying to connect my project in xcode to Firebase. I am using a blank single view application template and have not bothered with adding any buttons or more view controllers. I am just testing it and trying to connect it to Firebase. So the problem I am having is is the app succeeds in compiling, but then as soon as the application opens in the simulator, it gives me a Thread 1: signal SIGABRT error. I don’t know what I am doing wrong. I have followed all of the installation instructions correctly. I went to Firebase and configured the app with the bundle indentifier. I added the Google-Service.plist file into xcode. I succesful installed all of the pods into my project. I go into the app and add
import Firebase
FIRApp.configure()
into the delegate swift file. I save the project and close it. I open the app workspace file (the one it recommends to open) And then without adding anything to the project or adding any user interface options, I immediately run the project, it says build succeed and then instantly crashes and gives me the Thread 1: signal SIGABRT error. Does anybody have any ideas of what this is? I don’t know what I am doing wrong. I can’t move forward with swift and firebase if I can’t even configure it correctly. Can you please figure this out?
Here is the description of the error it gives me:
TestAppWithJack[71791] <Error> [Firebase/Core][I-COR000012] Could not locate configuration file: 'GoogleService-Info.plist'.
2017-01-14 17:06:19.456 TestAppWithJack[71791:2160021] *** Terminating app due to uncaught exception 'com.firebase.core', reason: '[FIRApp configure] could not find a valid GoogleService-Info.plist in your project.
Did you make sure that the google plist is specifically called GoogleServices-Info.plist? If it isn't specifically that name, then it won't work.
Where did you put GoogleServices-Info.plist? If you dragged it to the wrong place, that could be why it was giving this error because it cannot find the file... Drag GoogleServices-Info.plist under your info.plist it should be fine then.

Unable to debug a framework in Xcode 8

I have a framework project I built in debug mode. I added such resulting framework to another iOS project. My iOS project builds correctly and the framework is called, I get its methods results. However, some of the results are not the expected and I need to debug the framework's code from the iOS project.
I am also running the iOS project in debug mode and setting a breakpoint at the framework's method call I want to debug. But "step into" instruction in the debugger does not enter into the framework's code. In addition, if I "command-click" the name of the method to try to go to its code, I get an:
Couldn't Generate Swift Representation
My issue is similar to this one, but the answer there is not working for me. Is somebody experiencing the same? Could somebody provide another solution?

how to solve this the crash when running after updating to swift 3?

I just updated to Xcode 8 (swift 3). Converted code, etc. No errors. A few build warnings...nothing that should be an issue.
When I run, with my IPHone connected, it crashed with a Thread 1: signal SIGABRT . It has hardly anything in the trace back other than
0_abort_with_payload
5 _dyld_start
and the console error is
dyld: could not load inserted library '/Developer/usr/lib/libBacktraceRecording.dylib' because no suitable image found. Did find:
/Developer/usr/lib/libBacktraceRecording.dylib: code signature invalid for '/Developer/usr/lib/libBacktraceRecording.dylib'
I had the same error since upgrading to xcode 8 (swift 3). The fix, for me, was to add an entry in info.plist
To add the permission information for the microphone:
Open info.plist
Add a new key called "Privacy - Microphone Usage Description"
Enter a string that describes why the app need microphone access
Just restart your iPhone device.
It mainly crash because you have to write some privacy thing in info.plist if you are using hardwares like camera, gallery etc. Check console for details and add everything you are using in info.plist of your app.
I had the same problem and finally figured it out. I created a Framework in Swift 3 that I then added to one of my other projects. This project that I added it to uses both Swift and Objective-C but is originally an Objective-C project.
For some reason the Framework made in Swift 3 was causing my app to crash immediately when running on an iPhone with that exact error. I deleted the Framework and now it is running fine.
Again, not sure why this happens because the Framework was working fine with the app before and works fine on simulators. So I guess it has to do with the Framework being created in the latest XCode with Swift 3. Maybe someone else can clear this up.
Hope this helps someone!

How to prevent framework to jump into the .m file when crashing in iOS

I am using XCode 6 to develop a SDK using static library. I grabbed the script from this link: http://www.raywenderlich.com/65964/create-a-framework-for-ios.
When I tried to crash it intentionally, the actual implementation is exposed. However, we wanted to hide it. Just like crashing a third party framework, for example Parse iOS SDK, it will jump to something like assembly code instead of the actual implementation file.
Here is image when crashing in Parse:
Any advances would be appreciate.
I think your setting is all correct, you can still see your implementation because you are using the same computer as you did development and being symbolicated automatically. It will be hidden when other users try to crash it.

Resources