Not able to integrate latest ZXingObjC library in iOS - ios

I am working on a barcode scanner app and would like to integrate ZXingObjC library to my app because ZXing is the only free library that supports data matrix scanning. I have gone through its README file and tried to integrate the library. But its giving some weird errors like "Multiple methods named “encode” found with mismatched result, parameter type or attributes".
So I thought may be those are ARC problems and tried to convert it to ARC but no luck. It is throwing so many errors!!
I am still struggling with integrating this library. It will be really helpful if anyone can help me on this.

The reason stands behind this answer:Defeating the "multiple methods named 'xxx:' found" error.
Please have a look and try casting objects before calling those methods accordingly.

Related

Retrieving finder comment of a file in iOS application

I am trying to use the finder comment field of a file stored in the folder of my iOS application (I'm talking about local storage, not in the cloud). The function MDItemCreate that would enable me to do so easily is not available in iOS applications apparently, which must be why the build currently fails with the error warning : "Cannot find 'MDItemCreate' in scope". Apple documentation in fact states that this method is only available on MacOS.
I have tinkered with FileManager but it doesn't grant access to comments.
This topic seems related but the solution is quite opaque to me.
My understanding of Swift is rather limited, if you would be so kind as to provide a simple and detailed answer I'd be much grateful.
With thanks,
Julien
I'm not completely certain, but messages like "Cannot find 'X' in scope" are often due to a forgotten import statement. MDItemCreate(_:_:) (docs) seems to be part of the Core Services framework, which has been part of iOS since iOS 12. Have you imported the framework?
You can do this (at the top of your .swift file) as follows:
import CoreServices

Semantic Issue: Cannot find the protocol declaration for ‘ARSessionDelegate’

Do anyone know the workaround for the build error on Xcode?
All suggestions are welcomed.
E.G: Impossible in that way, Possible with Objective-C, not Swift
Environment:
Swift:3.2, Xcode:9.2, Unity:2017.3.0f1, iOS:11.2.1
Condition:
I’m trying to make Native Plugin for Unity using Swift like this.
Unity C# -> Objective-C -> Swift
For now, I could access the iPhone camera roll from Unity.
The Project Name is GetDepthSample here.
Error Detail:
As soon as I add ARSessionDelegate on the class definition, I got the following error.
CameraRollSample.swift
Other Information:
GetDepthSample-Swift.h (generated automatically on Xcode) shows the following error.
GetDepthSample-Swift.h
It’s possible to jump to Definition of the protocol ARSessionDelegate.
Not only ARSessionDelegate but also MetalKit shows the similar error.
The original Unity Project
https://github.com/wapa5pow/CameraRollSample
Many thanks!
Looking at the header that you posted in the comment, it seems to me that maybe you need to include the ARKit framework in the project settings in Xcode. Although this generally tends to work automatically clearly something in your setup has that missing.

How to create framework with other frameworks and library dependency?

I know, there are so many same questions but I didn't get answer for my requirement.
First time I am creating framework. I have created test framework using Raywenderlich example. But my requirement is little bit different. I used so many different frameworks and also used SQLCipher in my project. Now, I want to convert this project into framework. I followed all the steps but the problem is occur when I am trying to build. Getting an error for SQLCypher because I didn’t add to my framework to avoid conflicts. Finally, I have added SQLCypher library to create build without error and it worked but now I am getting linker error when I am using that framework to test in testProject. I didn’t find any example with third parties. Please help me to solve this issue.
I had the same issue.
One solution is to change all method names of other frameworks or libs, but some lib is not open source.
Another solution is work for me which is to use cocoapods. But the user
who wants to use your framework will be forced using cocoapods, depending iOS 8.0 or above, depending the same version of 3rd libs. I have nothing to do with this restriction.
Seems the best way is do not depend 3rd libs in a framework.

BTOUCH error Bl1001 - do not know how to make a trapoline

I am trying to create an iOS binding library to wrap Kxmovie. I followed all the instructions in the Xamarin bindings library walkthrough and got as far as trying to build the library. However, it fails with the following error;
Error BI1001: bgen: Do not know how to make a trampoline for IKVM.Reflection.Reader.ParameterInfoImpl (BI1001) (KxmovieBinding)
Does anyone know what this means or how to fix it?

Unity3d - ios duplicate method found with fmod

I am using an fmod plugin for Unity3D. Compiling to Windows and OSX is fine because I can dynamically load the DLL/dylib.
The problem comes when I compile for iOS. I use
[DllImport("__Internal")]
Because iOS requires statically linked libraries. When I compile though I get a
SystemException: Duplicate native method found : FMOD_System_CreateSound. Please check your source carefully.
I am quite sure I don't duplicate the symbol. I think this might be due to the fact that Unity imports FMODs itself and that the two might be colliding... But if this is the case, I am surprised that FMOD_System_CreateSound is the first one to get caught. Is there a way around this? thx!
As always, I will be happy to provide any additional details!
Here is a sample project that will cause the error:
Sample Unity Project with FMod
EDIT:
The conflict was caused by iOS not allowing functions to have the same name even though they don't have the same signature. After removing the same-named functions (thus removing some FMOD features that I didn't need), I can compile to iOS, but as expected, I still get an error when Initializing because FMOD is already initialized by Unity.
Unity3d already has a limited version of FMOD that is bundled with it, which is causing the conflict you are seeing. Unfortunately, it doesn't seem possible to disable it at this time, so that you can use the full version of FMOD
In reference to your edit and after looking at the sample, it is true that you cannot have two methods of the same name as the compiler will not recognize which to link to.
The easy fix is to obviously name them differently.
As for the initialization, if you can access the FMOD that Unity 3D already created, then you don't have to reinitialize it.
I assume that a pointer to that object will be sufficient to remove the duplicate initialization. Hope this is clear.

Resources