Class GAD_GTMStringEncoding is implemented in both <framework> and <app>. One of the two will be used. Which one is undefined - ios

I have an iOS project in Xcode. It contains a load of linked libraries including GoogleInteractiveMediaAds.framework as well as an internal player library that I believe is also linked against this framework. Both are also embedded binaries.
The project compiles just fine but at runtime I get the following error:
Class GAD_GTMStringEncoding is implemented in both
/GoogleInteractiveMediaAds.framework/GoogleInteractiveMediaAds
and APP_PATH. One of the two will be used. Which one is undefined.
On simulator the app works as expected every time despite this warning - I get the pre-roll, mid-roll and post-roll ads that I'm expecting. Every time. On device it's a different story with the ads sometimes working and sometimes not. I'm aware that the above issue results in different behaviour on different targets and I suspect this conflict is to blame for the broken functionality on devices.
Solutions I've found here on SO suggest either changing the namespaces or removing the linkage from either my app or the library that I'm linking against. The problem is, if I remove the embedded binary in my project then it fails to compile:
dyld: Library not loaded:
#rpath/GoogleInteractiveMediaAds.framework/GoogleInteractiveMediaAds
Referenced from: APP_PATH
Reason: image not found
(lldb)
I've seen a few people suggest what would be removing the linkage from the app and using the player's internal instance (where I then have to hope that the player is compiled against the version that I need), but how on earth do you do that? And would that even work in this case?
Also, is there a way to find out for sure where this other instance of GoogleInteractiveMediaAds.framework is coming from? I'm only assuming that it's inside the internal player library but I don't know for sure as I don't have the source. The error message just provides me with the path to the compiled app which is of little help since there's like 30 linked libraries inside it.
Thanks in advance.

After initially insisting that the issue was somewhere in our code, the Google team responsible for this framework were eventually forced to admit (after we provided a sample app) that it was a problem with their code and not ours. It was resolved in an update.

Related

Transferring Xcode Project from one computer to another brings random errors?

I have a Xcode project I got from another developer. Initially when I opened it it has a bunch of errors (most of which were un-updated frameworks). I got it to work after a while and I fixed it. I want pass it back to the manager since I'm leaving uni in a few months. I copied it over to my friends Mac to see what would happen if I just took the project and all it's folders and made it a zipfile. It didn't work for some reason. It gave me an error:
error: using bridging headers with framework targets is unsupported
But why did that come up? I mean it's the same code on the slightly different versions of Xcode (13.1 versos 14.1) but I doubt there was a massive change between the two that would cause this. I want to be able to pass these app later in the future without having to care about this stuff. I made a GitHub (link below) would cloning that work? Also the laptop I chose was just a fresh reset. Would it be due to not having coco-pods installed?
I feel like I could go through and fix it all on that laptop and document that but then I'm afraid that every time I put it on a new one it would come up with random errors every single time making my documentation moot.
https://github.com/AbdullahMSaid/SonicExperiment-Works
With big help this was Fixed.
Things that fixed it.
Having the correct version of Xcode
Turning everything from absolute path to relative
Lots of other code fixes. But those are my project specific.
You don't need bridging headers in framework. Use should have something like "YourFramework.h" where you can import your .h files.

How to create framework with inner frameworks?

I absolutely can not understand how it works. I started with a simple one: created framework using "Cocoa Touch Framework" template and add some code to source files. Then using cocoapods I installed some pods to this framework-project. All looks good (maybe not so good actually) and build fine. After that there was an attempt to connect my framework to other xcode project. I did this as follows: just took my test.framework file from Product folder and transferred to another project. At first everything was not bad. The import was successful and I can use my framework-code in another project. But when I run it I have error: dyld: Library not loaded: Reason: image not found. I tried all of the answers to this problem, but nothing helped me.
After that, it was decided to try to connect my framework to other project. This time I got a completely different behavior: namely, I was able to connect the framework, but I could not access the code inside it. I'm completely confused, because I did not change anything. I just did the same with another project.
Please help me. What am I doing wrong?
A related questions:
Can I connect the framework just moving test.framework file into
another project?
For some reason, I should use the approach described above, is there a chance in the theory of success or all that I have done before is not correct?
I tried it a lot with the same result you get , until I posted the problem in Apple forums and they respond with Nested frameworks are not supported in IOS

Flash as3 ios: error #2007: parameter possible symbol clash in multiple swfs, abc env must be non-null

I'm developing an app for iOs using flash air, version 3.8, this version allow me to load a externals swf with assets, flash professional cs6 and flash builder 4.7
I have some kind of lobby where the user select a differents games. If I deploy the app just with 1 game (1 swf), I would loaded a game without problem
But, If I deploy the app with other games, I would just loaded 1 of them swf, but the other games give me this error:
error #2007: parameter possible symbol clash in multiple swfs, abc env must be non-null
The parameter abcenv doesn't exist in my code.
Thanks in advance
I have found exactly the same issue it also happens with AIR 3.9 You can only do this by embedding the game logic into your main menu and constructing classes as you need to. I know this makes the initial part of say your menu heavier.
You can however load in swfs as library assets, if you need this. I think the bug has to do with swfs and a restriction of overlapping classes and the fact that you can only use one Application Domain. But this is my best guess on the underlying restriction with this. If you do find a work around let us know.
I encountered this error and solved it today. After Google I found nothing can help. Now maybe I'm the only person that solved the problem easily. This is my story:
Working on a AIR actionscript mobile project.
In ad-hoc package for iOS, loading multiple SWF files successfully, except two. Those two cause the "Error #2007: parameter possible symbol clash ......" error.
Found there is a very small difference between the normal SWF and the error one: in the error SWF, one MovieClip is 3D transformed, I saw there are three 3D axis above the MovieClip. Then I deleted the MovieClip from stage and Library and replaced with a new one. Problem solved.
Note that I didn't re-name anything, or delete any duplicated things. In fact there are many duplicated things (image file with same name, and MovieClip copied between the SWFs) in the SWF files.
I ran into this same issue. The issue is that AIR for iOS has to compile ALL of the external .swfs together, so if there are naming conflicts, that can cause trouble. This especially seems to be a problem if two or more of the .swfs were made from the same cloned .fla, even if one of the files had changes made to it.
In my case, it turned out that there were several unused earlier versions of .swfs in the folder of .swfs to be loaded (such as external_movie-prev.swf). I was able to solve the problem quite easily just by deleting these extra files.
This is a common technique in development, just to rename a previous version of a file and add in a new version to the folder for testing. In normal software development these extraneous versions do no harm. But in the case of AIR for iOS, this situation can cause your app to inexplicably freeze when you try to go a movie that also has an unused previous version in your assets folder. This took me several hours to chase down, so I hope it helps someone else.

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.

Using DTCoreText with RubyMotion

I'm currently working on my first major RubyMotion application. I have a lot of html text to display, and want to move away from using UIWebView -- as it's a bit of a hack and it's hard to size correctly without a lot of hoops. So, one of my options is DTCoreText, which seems like the most used and stable control of this lot.
I originally tried to use the CocoaPod version, but for some reason it's causing issues with MKNetworkKit from another pod. I messed with it for a bit, but saw that there are a lot of reported issues in MKNetworkKit about the build process, so I best left it alone.
Instead, I went for the vendor option. I git cloned the DTCoreText repo into my vendor directory and added it to my project. While it gets me closer by compiling the library and making my libDTCoreText.a file, I'm still stuck after actually running it.
My Rake files includes this (the rest is pretty generic):
app.vendor_project('vendor/DTCoreText',
:xcode,
:target => 'Static Library',
:products => ['libDTCoreText.a'])
app.libs << '/usr/lib/libxml2.2.dylib' #For DTCoreText
Like I said, the libDTCoreText.a file gets compiled and copied into the right place in my project.
My app has this in the code. It's as basic as possible -- I just wanted to see it work.
#source = DTAttributedTextView.alloc.initWithFrame(CGRectZero)
#source.attributedString = NSAttributedString.alloc.initWithHTMLData(post.source.dataUsingEncoding(NSString.defaultCStringEncoding), options:{}, documentAttributes:nil)
#source.frame = [[self.frame.size.width / 2 - size.width / 2, 600], [250, 250]]
The application compiles, fine but at runtime when we hit the code above, it crashes with:
Objective-C stub for message `initWithHTMLData:options:documentAttributes:'
type `##:##^#' not precompiled. Make sure you properly link with the framework
or library that defines this message.
*** simulator session ended with error: Error Domain=DTiPhoneSimulatorErrorDomain
Code=1 "The simulated application quit." UserInfo=0x10019d470
{NSLocalizedDescription=The simulated application quit., DTiPhoneSimulatorUnderlyingErrorCodeKey=-1}
Does anyone have any ideas where I can start looking? I don't know a ton about the XCode build process yet, so it's possible I'm missing something. But it just seems like it should work. It's saying to me that it can see the headers correctly (and can compile), but it doesn't know where the actual library is.
Well, I have relevant experience with DTCoreText but none with RubyMotion. DTCoreText uses categories, and as such has special load requirements. In my Xcode project, in "Other Linker Flags", I have this: -force_load $(BUILT_PRODUCTS_DIR)/libDTCoreText.a
That line insures that the library is properly loaded. If you don't do that, you get crashes when you try to use it.
I've been very happy using DTCoreText now for a year, and IMHO its a much better solution for attributed text than using UIWebViews.

Resources