Google maps iOS SDK breaks when a certain library is linked into the application - static-linking

Background
I am exploring using the Google Maps iOS SDK in an application that will also tightly depend on another statically linked C++ library. I have accomplished Google's prescribed Hello World program successfully with one caveat: using the -ObjC linker flag causes linker errors with my other library. To remedy this, I've been using the -force_load /path/to/GoogleMaps instead in order to only target the GoogleMaps framework, which seems to work well.
The Problem
When I reference certain (not all) classes inside the static library in custom C++ classes in my app (even if I don't instantiate those classes in the app itself) I repeatably see this strange runtime error:
ClientParametersRequest failed, 3 attempts remaining (0 vs 5). (null)
ClientParametersRequest failed, 2 attempts remaining (0 vs 5). (null)
ClientParametersRequest failed, 1 attempts remaining (0 vs 5). (null)
ClientParametersRequest failed, 0 attempts remaining (0 vs 5). (null)
The result in the app is that the pin and default off-white google background appear, but no maps are downloaded.
If I delete the app from the simulator or device and comment out the static library code and run the app, the maps load and everything works fine. Then, if I add those lines back in and run the app, I don't see these errors and the maps still load fine.
If I delete the app and leave those lines in for the firstrun of the app, I get these errors, but if I then comment out the library code and re-run it, the maps begin to load and all is well. Adding back in the library code does not cause the error messages/runtime issue to come back.
This leads me to believe that the error is occurring in some sort of initialization routine that is never subsequently called. I checked the files in the app sandbox and some are missing until the maps load properly, which makes me think this is correct.
I have access to the source for the static library but obviously don't have access to the GoogleMaps SDK. There does not appear to be any clear documentation about what this error means, especially in my case where (null) is the final piece.
A few final notes that may or may not be relevant:
C++ Language Dialect: C++11 [-std=c++11]
C++ Standard Library: libc++
Thanks in advance for any help!

Related

AUv3 MacOS Instrument, auval failure "Bad Max Frames - Render should fail"

This is the umpteenth time I've tried to create an AUv3 plugin, all with various amounts of success (no complete joy, ever :/ )
It works in the app, but auval fails with
Bad Max Frames - Render should fail
ERROR: AudioUnitRender should have returned an error for too many frames but returned noErr
Current OS: 10.13.5
XCode: 9.4
created an AUv3 MacOS Instrument by creating a Cocoa Objective C app
added an AudioUnit app extension
added a Cocoa framework
etc. Details supplied if needed. (I made notes about my steps since I've never completely succeeded previously.) It is essentially the same as the Demo MacOS AUv3 instrument but I started the project from scratch. The only swift code is in SimplePlayEngine.swift. The rest is Objective C, Objective C++, and straight-up C++.
The only web search hit I found on this problem is add arg to prepareInputBufferList but there are two problems with this link:
Applying the change doesn't fix my problem
The demo AUv3 instrument builds and passes auval validation on my system with no modification.
I don't know if this is related but I find that NO breakpoint I set in the audiounit or related files (BufferedAudioBus.hpp) is ever hit. Since the audiounit functions in the app I must assume that the code is getting executed but something about the way it was built is wrong. (NSLog messages don't get printed either ... ??? (yes I know that when realtime rendering, printing to the console is a bad idea)).
I diffed between my AU source and the demo AU and the only changes are name changes. The "Build Phases" are comparable.
I know this is a pretty non-specific question, but I've run out of ideas. Does anyone have any ideas where to look to resolve the "Bad Max Frames" auval failure?

Why does LLDB refuse to break on compiled objective C methods?

I have a compiled objective-C binary on iOS 8.1 which I am attempting to debug with lldb on my machine and debugserver on the handset. (No XCode involved- though I am willing to get it involved if that is the issue.)
Ida can correctly recognize the binary as objective-C and decompose objects and component messages. Because of this, I would expect commands like
platform select remote-ios
connect://ip:port
breakpoint set --name "-[Login doLoginStuff]"
to correctly function, but this method is called in code without breaking in lldb.
Is there the need for some type of target call to hint to the debugger what the remote architecture or SDK target is?
Without the symbols I don't believe lldb can map -[Login doLoginStuff] to a memory address. If it cant find the name it fails silently as far as I remember.

JSTileMap generating warnings in ios7 SpriteKit template

I am copying JSTileMap and LFCGzipUtility into the project and when I run the application it generates several warnings for both files.
However, when I run the provided sample from github, I don't see any of those warnings.
I would like to know why is there a difference, and in case, what am I doing wrong?
For reference please visit, https://github.com/slycrel/JSTileMap
Clarification, I would like to know if there is anything I should change in the project settings, rather than debug the code that runs just fine and without any warnings on the provided sample at the links above.
if you are running your app in the iOS simulator 64 bit mode then the problem is that the files of JSTileMap are not updated to 64 bit architecture
Apple documents says
Code that relies on the NSInteger and CGFloat types needs to be carefully examined.
Start by building the app for the 64-bit runtime, fixing any warnings that occur as well as searching your code for specific 64-bit issues. For example:
Make sure all function calls have a proper prototype.
Avoid truncating 64-bit values by accidentally assigning them to a 32-bit data type.
Ensure that calculations are performed correctly in the 64-bit version of your app.
Create data structures whose layouts are identical in the 32-bit and 64-bit versions of your app (such as when you write a data file to iCloud).
here is the Apple's transition guide to 64 bit:
https://developer.apple.com/library/ios/documentation/General/Conceptual/CocoaTouch64BitGuide/Introduction/Introduction.html
if that is not your case the open the file JSTileMap.m, inside press command + f type warning and press enter
and you will find all the warnings that JSTileMap want you to see just comment all warning and thats it
Here i show you all the warnings
#warning these appear to be incorrect for iso maps when used for tile objects! Unsure why the math is different between objects and regular tiles.
#warning This needs to be optimized into tilemap layers like our regular layers above for performance reasons.
#warning the positioning is off here, seems to be bottom-left instead of top-left.
#warning need to write setTileGidAt:
Good Luck!!

Q_STATIC_ASSERT & Q_STATIC_ASSERT_X compilation problems on Visual Studio 2010

I develop and maintain a very large opengl application, written using qt library. I'm switching from qt 4 to qt 5. I downloaded the qt 5.0.0 Windows (8) Visual Studio 2010 precompiled package. Unfortunately I discovered that I get millions of OpenGL errors caused by the OpenGL ES 2 support provided by the precompiled package. So, I downloaded the source code and I recompiled qt using the -opengl desktop flag on the configure step (for further details on the problem please refer here). The opengl compiler errors disappear but I still have hundreds compiler errors everytime inside the Qt library itself there is a reference to two macros Q_STATIC_ASSERT and Q_STATIC_ASSERT_X.
The typical kind of errors i get are:
- error C2062: type 'void' unexpected
- error C2238: unexpected token(s) preceding ';'
Some suggestions?
Thanks
As described in the comment to the question I solved the issue by looking for redefinition of static_assert and commenting it.
In particular my code was using the VCGLib library wich was redefining the assert in base.h

iOS framework with dependencies

I have created two iOS .frameworks
they both compile perfectly
my structure is as follows:
iPadProject
- framework1
- framework2
So Framework2 is included in framework1 and framework1 is included in the actual iPad Project
So my problem is, if I add both framework1 and framework2 into my iPadProject it won't compile because its whining about duplicate symbols from framework2 ( that's logical because it was already included in framework1)
But if i only include framework1 into my iPadProject when i access a method from framework1 that in his turn access a method from framework2 it crashes the application with "signal SIGABRT"
Do not nest static libraries, including iOS frameworks. As you've seen, it leads to major problems (it leads to even more problems when two frameworks each have their own version of the third). The final link step should link all libraries required; static libraries should never link other static libraries. There is no really good way to automate this; it just has to be part of the documentation for the framework.
You shouldn't be getting runtime exceptions, though, for failing to link a framework. You should be getting link-time failures that indicate that the symbol isn't defined. If you're getting a crash, that suggests you're doing something strange in your linking.
the problem is that because it is nested right now, the linker links f2 into f1 -- BUT only the parts of f2 that are needed by f1.
like
f2 has 5 symbols (f2_1 - 5)
f1 uses f2_1 and f2_2 but NOT 3,4,5
=> the linker throws it away
now the app needs f2_3, f2_4 and f2_5 but they aren't there... but nobody knows that at compile time.
now you try to resolve it by linking the app with f2 again but as before nobody at compile time the linker optimized out f2_3 - 5 and they are assumed to be in f1 and so are duplicates!
the way to solve this Rob Napier already mentioned. Don't nest Frameworks (mainly not static ones / 3rd part ones)
a workaround is to pass -all_load to the linker when f1 links in f2!