Unity project iOS Build Ads Error - ios

I have built a iOS project with Unity and added a asset from the Unity Asset store called, Very Simple Ads. When I built the project in Unity, I had no errors, when I opened the project in xCode I have 12 errors. Which are "Apple Mach-O Linker" errors. Here is a screen shot of all the errors: SCREENSHOT
I know the errors are to do with the ads, but I am not for sure.

please make sure you have setup import settings for plugin correct and check iOS platform checkbox.
Currently, the problem is your plugin did not exported right and linker can't find listed methods.
Please read more information about plugin import settings here
https://docs.unity3d.com/Manual/PluginInspector.html

When you export via unity to xcode you have to put frameworks for ios from the screenshot i came to now tat you have integrated google mobile ads so you need to add google mobile ads framework to your xcode project
you can do so by simply going to project setting general and scroll down to frameworks use the small "+" sign at the end of the frameworks to add the frameworks or simply drag the downloaded framework to the hirarchy of your project in frameworks folder
You can download google mobile ads framework from the link below
https://firebase.google.com/docs/admob/ios/download
Regards

Related

Kotlin Multiplatform iOS Integration. Issue in linking shared.framework for respective architecture

Kotlin iOS Integration:
KMP is creating a separate shared.framework based on architecture (Simulator/iPhone). Both the frameworks are generated under the Debug directory. As the frameworks search path is set recursive it searches for incorrect framework and throws error and my iOS apps compiling fails.
I am not able to find out which framework to link depending on selected platform Device/Simulator.
Just wanted to know if there is any possible way to handle this issue of multiple frameworks so I can switch between Simulator or Device and the Xcode matches and applies the correct shared.framework
I needed to add /$(CONFIGURATION)/$(SDK_NAME)and make it as non-recursive.
Now even if I run app on simulator and then on actual device, Xcode maps & links correct shared.framework.
This solved my issue.

How to enable "always embed swift standard libraries" for a xamrin app?

I have a xamarin forms app, in which I am using a binding dll generated for a swift framework.
But as per apple doc,
If you are building an app that does not use Swift but embeds content such as a framework that does, Xcode will not include these libraries in your app. To workaround this issue, set the Embedded Content Contains Swift Code (EMBEDDED_CONTENT_CONTAINS_SWIFT) build setting to YES in your app. This build setting, which specifies whether a target's product has embedded content with Swift code, tells Xcode to embed Swift standard libraries in your app when set to YES.
So how can we enable this build setting for a xamarin app ?
[Edit]
SwiftRuntimeSupport NuGet package is already part of the project. But still, on checking the ipa, it was found that the swiftSupport folder includes only an empty iphoneos folder.
Xamarin has a SwiftRuntimeSupport nuget that handles the iOS version and build details.
Use the SwiftRuntimeSupport NuGet package to automatically include required dylib dependencies into the resulting application package.
Consume the Xamarin binding library
Blog Post: Binding iOS Swift Libraries
Recently, I got an error with using Swift libraries and I tried #SushiHangover's solution. While the library itself did not solve the problem, it had these instructions in the Readme file for uploading the Archive using XCode instead of Visual Studio, which solved my problem:
In Visual Studio, select a valid iOS device before archiving.
Go to Build menu / Archive for Publishing
Once done, open Xcode and go to Window / Organizer
Select the Archives tab
On the left side of the window, select your app
Click on Distribute App button and follow the wizard

Integrate Firebase Crashlytics (beta) SDK in iOS project without PODS

I am integrating FrirebaseCrashlytics SDK in tvOS and iOS without cocopods. I downloaded their xcFramework. But I can't use the xcFramework as the project is not compatible so I drag and drop ios-armv7_arm64 framework to project and added Firebase.h and module.modulemap (my project uses both objc and swift). Also, I specified the Firebase.h in the bridging header. I get below error when I build.
Showing Recent Errors Only
/Users/xxxxx/Code/ios/tvOSApplications/App/App/Firebase.h:15:9: 'FirebaseCore/FirebaseCore.h' file not found
Showing Recent Errors Only
/Users/xxxxx/Code/ios/tvOSApplications/App/App/App-tvOS-Bridging-Header.h:27:9: Could not build module 'Firebase'
Multiple problems to address (based on instructions in the README at the base of the distribution:
The zip distribution requires Xcode 11 which supports xcframeworks
The zip distribution only supports iOS. tvOS is only distributed via CocoaPods
All Firebase installations require the xcframeworks in the Analytics folder to also be installed.
I am able to get firebasecrashlytic .framework files without cocopods using Carthage. I copied files to project and it works in iOS project. I am looking for a similar solution for tvOS
Recently I had a similar requirement of supporting Firebase on both iOS and tvOS. As the frameworks are available only on iOS and not on tvOS. I could not integrate Frameworks. So the solution I followed is adding of Source files provided in https://github.com/firebase/firebase-ios-sdk corresponding to the required modules that are needed for enabling Firebase Crashlytics.
This solution worked for me and able to see the crashes. Let me know if you need more information
I got Firebase Crashlytics working for tvOS without Cocoapods or XCFramework bundles. Basically, you just need to bring over the source files, set the header search paths, and set all the required preprocessor macros. You can read the story here.
Thanks for the hint Gangadhar!

Unity Game will not build with GoogleMobileAds

I have been trying to build my game to iOS for quite some time now but whenever I try to build the project with GoogleMobileAds it won't work. The ads work fine on android but not on iOS. If i remove the GoogleMobileAds completely the project builds fine but not with the ads.
I have followed the documentation to the best of my ability but I just can't seem to get it to work. In the documentation it says that after building the Xcode project in Unity you should also get a Cocoapods workspace file but it doesn't seem to show up. What could I be doing wrong?
Thank you for any help you might give.
If any one happens to stumble upon this later and have the same problem. Here is how i solved it:
Unity would not generate a podfile for me like it says it should in the developer guide, maybe I haven't installed Cocoapods correctly. Regardless, in the end, the fix was quite easy.
I manually downloaded the Google Mobile Ads SDK and added it to the Frameworks folder in the Xcode project. (If you are more experienced with xcode/cocoapods than I am you could probably just write your own podfile that would do this for you)
Then I changed "Enable Modules (C and Objective-C)" to Yes in the Build Settings
Lastly I added "$(inherited)" to "Other Linker Flags"
After this everything compiled like it should and the ads worked fine.

Could adding a framework to an iOS project block/hide access to other files in the project?

After adding the Dropbox SDK Framework to my Xcode project (iOS) my project fails to build due to errors shown in image 1 below:
Prior to adding the Dropbox Framework, or reverting to the previous commit, results in the project building and running with out issue. I have also tested the same Dropbox SDK Framework package in a seperate demo project to ensure it is not corrupted - and that demo project builds and runs just fine, accessing the Dropbox SDK as expected.
Is it possible that the Dropbox SDK Framework is hiding or blocking access to the GLKit Framework within my main project?
Or is there something else at play here? The second error shown in screenshot claims the bridging header also 'Failed to import' which is an error I have not seen before, usually it is 'not found'.
The Dropbox SDK Framework is being added by drag-and-dropping into Xcode and checking the copy if needed box. Immediately after adding the Dropbox SDK Framework the project no longer builds and reports these errors.
I am answering my own question for anyone else who might have similar problems. While I did not find the root cause of the problem, I did get around it with the following solution.
I ended up removing all third party frameworks from my project which were:
ResearchKit Framework
Dropbox SDK Framework
Charts Framework
And in addition I removed all the XCode supplied frameworks from the project in the left hand file list: 'Project Title -> General -> Linked Frameworks and Libraries'
I then installed and setup CocoaPods with the project, and used CocoaPods to install and manage my third party frameworks (ResearchKit, Dropbox SDK and Charts)
The project is now able to build and run successfully and has access to the GLKit framework along with all other XCode supplied frameworks, bridging header and Dropbox SDK.
I assume this issue was due to a setting in XCode that was preventing access to GLKit after the Dropbox SDK had been added, and using CocoaPods to manage the integration of the third party frameworks skirted this issue.
If anyone has any further insight I'd be very interested to hear you explanation.

Resources