Use native framework inside Unity in standalone build - ios

I have a Unity project that uses a native ios framework from C# scripts. When I compile it for iOS app (.ipa), everything works fine.
I want to compile it for macOS, too, that means Standalone build.
To enable that, I check Standalone in import settings:
Then build the app for Standalone platform:
It builds an app, but it is unable to access native framework, and I don't see it inside package contents:
What am I missing?

unable to access native framework, and I don't see it inside package
contents:
The structure is:
Project-Name/Assets/SDK-Name/Plugins/iOS/SDK.framework
There are two issues:
1.The directory you put the plugin.
You put the iOS plugin the Plugins/iOS folder which works fine.
For Mac OSX, you put it in the Assets/Plugins folder. This is also where you put plugins for Windows and Linux.
2.You must convert or build the plugin or framework into a bundle. This bundle is what you should place in the Assets/Plugins folder.

Related

How to import external iOS framework in flutter plugin?

I'm doing a flutter plugin for stream video by using RTSP protocol. I had no problem develop it for Android, but in iOS things are more complex. I have to use an external library (SGPlayer) for getting the player work. I also downloaded the demo that uses this library and seems to work. This library is NOT on Cocoapods and I need to import it directly into the plugin project from my file system. the downloaded and compiled file structure of the plugin that I would like to use looks like this:
My problem is adding the ".framework" extension file correctly to the iOS project in a way that I can use it to develop the flutter plugin (iOS part).
UPDATE:
I built the project with the framework by using instructions at this link: https://github.com/flutter/flutter/issues/17978
The problem now is that while compiling the framework it change the umbrella header because, I think, it's not using the framework module.modulemap but another one. The result is that is importing just some header and implementations, and not all.
1.Place myFramework.framework to iOS plugin folder /ios ex: myPlugin/ios
2.Update iOS plugin file: myPlugin/ios/myPlugin.podspec
Adding the below line at the bottom of the file, above 'end'
s.vendored_frameworks = 'myFramework.framework'
In Terminal : cd to myPlugin/example/ios
run command
pod install
or
pod update
Now we can find the iOS plugin code by open iOS project (example/ios/Runner.xcworkspace) in XCode and go to
#Lorenzo you can pack your plugin and make private CocoaPod or Carthage repo.
Here is a good article howtos

How to integrate .proto files in Xcode compilation?

I am trying to port an android app to ios and new to mac/xcode ecosystem. My app uses Google proto buffs and using instructions at https://github.com/alexeyxo/protobuf-swift/blob/master/README.md I am able to build protobuf for swift and add ProtocolBuffers.xcodeproj to my project. I was even able to generate .swift files for my proto files outside of xcode using protoc directly. However, my question is how do I integrate .proto files in Xcode so xcode can find/compile them? Do I need to copy my .proto files manually in my project? I am using Xcode 7.2.1 and protoc version is 3.0.0. Thanks in advance.
Create a build rule for *.proto files, something like this:
Add your .proto file to "Compile Sources" build phase list.

XCode clang error no such file or directory with Push Plugin (Cordova project)

I am developing a cordova project. A project which is intended to run cross platform: Android, Windows phone, iOS.
I using this pushplugin to implement push notifications: the push plugin is intended to communicate between the device and the relevant push notification system (Android: GCM, Windows: WNS, Apple: APNS): https://github.com/phonegap/phonegap-plugin-push
On a windows pc, in the visual studio, I have managed to implement push notifications in a todo app. The app runs well in the cross platform solution which runs on visual studio.
Now as you may know, in a Cordova app, when building for a specific platform, folders for each platform are created as sub folders to a folder called platforms found in the project directory.
When I tried building for ios and put the project folder on a ios computer, I am opening the project in Xcode and trying to run it, but I am getting these kind of errors referring to the same push plugin:
clang: error: no such file or directory: '/Users/Jurgen/Documents/Xcode/backbonetodo/BackboneToDo/platforms/ios/BackboneToDoPluginsphonegap-plugin-pushGCMLibrarieslibGGLCloudMessaging.a'
clang: error: no such file or directory: '/Users/Jurgen/Documents/Xcode/backbonetodo/BackboneToDo/platforms/ios/BackboneToDoPluginsphonegap-plugin-pushGCMLibrarieslibGGLCore.a'
clang: error: no such file or directory: '/Users/Jurgen/Documents/Xcode/backbonetodo/BackboneToDo/platforms/ios/BackboneToDoPluginsphonegap-plugin-pushGCMLibrarieslibGGLInstanceIDLib.a'
I just copied the first 3 errors (but there are over 20).
The push plugin works fine on visual studio and normally by copying the project folder on a mac computer and running the .xcodeproject file from inside the iOS platform folder, I manage to run with no problems.
Any idea, what could be wrong? I am also notificing that after BackboneToDo there is no / and also after Plugins. It seems like the way it is creating the directory is not right. I also tried to change the location to absolute but this didnt solve the problem.
Any help?
Thanks in advance
While coping the files of deferent platforms make sure you don't copy the following files / folders.
cordova_plugins.js, cordova-js-src, cordova.js, plugins.
It seems like you have copied the push plugin for android in iOS project.

Building and debugging static library in Xcode using external build system

I'm trying to embed a set of static libraries that are made by an external build system into a project. I can get the external build system to build the libraries just fine in Xcode and I can use them in another project.
However, the project I am compiling (ffmpeg) produces several static libraries and I'm not clear at all how I should set this up in Xcode such that it can be referenced by another project and when I change the ffmpeg source it is rebuilt and can be debugged. Any pointers?

how add manually a cordova plugin to ios existing project

i've a cordova project created via cordova cli command.
i build the project for Android and iOS platform but... i copied the build project into respective workspace (eclipse/xcode) and i updated that single project.
Now i need to add a plugin.
The project into cordova project folder is now so outdate so i would add the plugin via cli and copy the plugin to the respective project.
I copied successfully the generated plugin into the android project, but i'm not able to do the same thing with iOS.
For example i added the console plugin for iOS
cordova plugin add org.apache.cordova.console
if i open and run the build project it work and i see my message in console, but if i try to copy the generated plugin into my existing project it doesn't work.
nobody could help me to understand how add manually a plugin into my existing project?
update
yes i know, i'll try to explain better
i have my cordova project under folder /Document/cordova
when i made an ios build via command line cordova put the built project under /Document/cordova/platforms/ios
well i copied the folder ios under /workspace/my-project-name
after some work under workspace i see that i need to add a cordova plugin.
i added the plugin via command line and it was added to /Document/cordova/platforms/ios
at this poin i have a project under /Document with plugin but asset outdated and one project updated without plugin under /workspace
i'm trying to copy from built project to /workspace project.
i copied
/workspace/my-project-name/my-project-name/Plugins
/workspace/my-project-name/my-project-name/config.xml
/workspace/my-project-name/www/plugins
/workspace/my-project-name/www/cordova.js
/workspace/my-project-name/www/cordova_plugins.js
but it doesn't work... i missed somethings?
After reading it several times I think I get more less the idea...
Well, I am not sure why do you want to copy the ios project outside the current location. I suppose you have a good reason to do it, however you can always tweak that project instead of going back and forward, cordova will not impact non cordova related files each time you run "cordova build".
Are you familiar with control versioning? Git, SVN, mercurial? If so it is simple just we which files were impacted once you add the plugin and copy those... If no, I suggest using control versioning anyways to help keep track of your code changes.
NOTE: Be aware if you build the cordova projet and then you just want to update the files noted above it is highly likely that it won't work, that is why you run "build" is not a simple file sync. I recommend taking the new cordova project with the plugin added and then just add you personal tweaks on the ios in the other folder. Or just tweak the ios folder inside platforms folder...
I hope you are doing for good reason. Anyway you are missing to copy below file to work
/workspace/my-project-name/my-project-name/platforms/ios/my-project-name/config.xml
Copying the cordova iOS platform folder is not a good idea. The reason is, cordova builds an Xcode project in the platform folder, and there is some sort of caching/built in references to absolute location of the original Xcode project. Therefore it would be unclear to you and to Xcode which file is being referenced from within Xcode. This may have caused some other unnoticed errors in the project as well. So therefore, instead of keeping original project path available along with the new path, I would recommend renaming the original project folder in order to remove the ambiguity. This way, you will assure that the right file versions are referenced.

Resources