I just installed CocoaPods and added a pod to my project in Xcode so that I could use the Google Maps SDK for iOS, and now I'm not able to get types or values for any variables in the debugger console. The only way I can see a variable's value is through a print statement in the code.
I'm using Swift 2.0 in Xcode 7.0 beta, and I followed these instructions almost exactly to install the pod into my project: https://developers.google.com/maps/documentation/ios-sdk/start. The only thing I did differently was to change the second line in the Podspec from "platform :ios, '8.1'" to "platform :ios, '9.0'".
I looked at the answers to this similar question: Xcode debugger sometimes doesn't display variable values?, but I was already using a debug build, and I'm pretty sure my problem is related to CocoaPods, because everything was working fine before I added that to my project.
This is known issue, you can find more info and starred isuue here.
TL-DR - Quick workaround:
Add Objective-C bridging header file and add #import <GoogleMaps/GoogleMaps.h>"
Remove all "import GoogleMaps" from your swift files
PS: Tricky stuff - you have to remove all imports from your swift files - I have forgotten to remove the one and it causes this debug issue.
I hade the same problem dunno if you solved it but, for me this happened because googlemaps was causing too many errors. So the workaround is remove all your googlemaps import in the projekt and add an import to googlemaps in your bridging header instead.
Updating to version 1.10.21020.0 of Google Maps SDK for iOS fixed the problem.
Related
I've been trying to add AudioKit to a project in Xcode to no avail - even blank projects created just to import AudioKit into my View Controller are throwing 2711 errors, mostly saying "'x' is not a member type of 'AudioKit', "Initializer does not override a designated initializer from its superclass", and "Method does not override any method from its superclass".
I'm trying to add AudioKit by directly adding the frameworks to the project as recommended by this video https://www.youtube.com/watch?v=iUvWxWvRvo8&feature=youtu.be, adding appropriate Framework Search Paths and Linker Flags to the build target.
I've read that these errors can be thrown by types and frameworks having the same name, and AudioKit contains a header file called "AudioKit.h". Changing the name of this throughout AudioKit didn't help, however, and the import AudioKit line started giving me a 'No Such Module (changed name)' error rather than the usual 'Failed to load AudioKit'. Changing the name of the framework as a whole had the same effect.
Is this an issue I can solve or something specific to AudioKit? I'm running Catalina 10.15.3. and have been able to install other frameworks via CocoaPods, but that didn't work for AudioKit. It's like pulling teeth here, I'd be grateful for input from anyone with the same issue.
These are the errors I'm being shown:
EDIT: Airdropping my project file onto a different Mac and compiling worked absolutely fine with Audiokit, so I've got no idea what the issue is.
Hi #Jowan and future readers, I had the same issue and found that it's best to stick with cocoapods, here's a working version for the latest ios and swift 5.2:
platform :ios, '11.0'
target 'AKRecorder' do
use_frameworks!
pod 'AudioKit', '~> 4.9.5'
end
I've reported the issue here if you want to take a look in other steps I took (How to include Audiokit 4 in a new project xcode 11 and swift 5.1?)
Good luck!
This issue also happened to me a week ago (my post: AudioKit Playground Builds fail) and the reason why it was brining up these errors, was because I didn't have the newest version of Xcode and AudioKit 4.9.5 only seems to work with the newest version of Xcode. To fix this error, you either need to update your Xcode, or download older version of AudioKit (what I did). To download the older version of AudioKit you can go to this website https://github.com/audiokit/AudioKit/releases and open the older AudioKit version assets, or you can to download it through cocoapods, you will need to write (pod 'AudioKit', '4.9.4') or a different version, in the pod file.
I've recently tried to include Audiokit 4 in a new project using Xcode 11 and swift 5.1, but I get the error message No such module Audiokit, the closest I get to Audiokit is CoreAudiokit by following the instructions in (https://github.com/audiokit/AudioKit/blob/master/Frameworks/README.md).
Here're the steps I followed:
1) Create new single view project in xcode11
2) Project settings, General tab, Frameworks/Libraries added item Audiokit.framework
3) In the ContentView.swift file: import Audiokit or import AudioKit
I've doubled checked the release notes and it clearly states support for Xcode 11 (https://github.com/audiokit/AudioKit/releases)
Finally, tried to compile it myself but the same issue as stated above, module not found.
git clone https://github.com/audiokit/AudioKit.git
./build_frameworks.sh
I can see the AudioKit framework under frameworks:
Other linker flags is also set as instructed:
Updated to Xcode 11.4 (latest), same issue.
Also tested moving the audiokit dir, same issue, nothing seems to make it work, so not sure what other people been doing considering the comments in github which seems they use it with Xcode 11.4...
Try changing the "Embed & Sign" setting for the frameworks to "Do Not Embed". The built frameworks are static and while they need to be linked in your project, they should not be embedded since they can't be dynamically loaded.
After hours trying things, I found a solution!
Just have in mind before proceeding that I've updated to the latest (time of writing) Xcode 11.4 and swift 5.2.
I've moved the file from Frameworks / AudioKit.framework to the project:
And then, while selecting the AudioKit.framework in the show/hide inspector, I change the location to relative to project and target to the current project name as follows (the name of the project changed to test in comparison with the earlier or original post version):
Obs: I've also tested by modifying the build settings, removed all subdirectories to exclude in recursive searches extensions; and add the relative path where the audiokit.framework can be found to the framework search paths. The autocomplete works, but I still get the error No such module 'AudioKit'. So, this far the only option that works is the comment before.
--------------------- a few days later ------------------------
Just had a quick look at this and decided to update the report here.
Unfortunately, the fix above removes the "not found" error but the application crashes. Using cocoapods to install audiokit also seems to not cause the "module not found error".
-------------------- weeks later --------------------
Use cocoapods to include audio into your project as last stated and as follow:
platform :ios, '11.0'
target 'AKRecorder' do
use_frameworks!
pod 'AudioKit', '~> 4.9.5'
end
I'm trying to install TwitterKit on my project via Fabric, but got stuck on this issue:
Could not build Objective-C module 'TwitterKit'
I'm using Swift and TwitterKit (2.2.0)
I've attempted to clean derived data, clean build folder already, doesn't work.
Attempted this solution as well, but didn't work for me:
https://twittercommunity.com/t/could-not-build-objective-c-module-twitterkit/49551
Here is the error:
Does anybody have a solution for this? Thanks a lot!
Had same problem yesterday. Add bridging header and inside import fabric and twitter. Worked like a charm
There's a slight chance that the deployment target value of the project's target is lower than that the TwitterKit supports.
In my case this was the problem. If the above solution does not work, you may check if the __IPHONE_OS_VERSION_MIN_REQUIRED value in TWTRKit.h is compatible with the target's settings.
I am trying to use google maps in my ios app my Xcode ver is 7.2 and swift ver is 2.1.1. I simply add GoogleMaps in my pod file everything is fine i added frameworks and libs which are required to support Googlemaps all fine, i am following this tut and according to this i have to add a bridging header file to include
#import <GoogleMaps/GoogleMaps.h>. My app already have one bridging header file because i am using facebook login as well so i put the import statement in the same file and in 'others linker flag -ObjC' is already there so after few required settings in storyboard i compiled my proj but i am getting this error "GoogleMaps/GoogleMaps.h" not found. I have searched for it and tried almost all the suggested ways on Stackoverflow but hard luck nothing worked yet.I will be really grateful if anyone could suggest me what i am doing wrong here.
Make sure your pod install went smoothly.
According to the tutorial,
You should see output similar to the following:
Downloading dependencies
Installing GoogleMaps (1.10.4)
Using SwiftyJSON (2.3.0)
Generating Pods project
Integrating client project
try
#import "GoogleMaps.h"
in your bridging header file
I have Xcode 6.3, using Swift, importing a Parse 1.7.1 Framework as usual (dragging, copying) and I set it up in a group: Frameworks.
I compile and everything works fine for a while with it, until the compiler does not recognize this sentence anymore:
import Parse
It gives me the error:
No such module 'Parse'
A workaround is to delete the Framework and copy it again, but after a while it starts getting annoying, and I would really like to know the cause.
I only code and build in the meantime (and occasionally creating new swift files), so I can't explain why this happens.
If you're targeting iOS 8 and above, you can tell Cocoapods to use frameworks, by putting
use_frameworks!
in your Podfile, like this example:
use_frameworks!
platform :ios, '8.0'
# Parse
pod 'Parse', '~> 1.7'
I could fix the same problem by doing so.
I just fixed this same issue today with my project. I imported my obj-c framework in a swift project and it worked for a while, then xcode seemed to forget it causing the same error you have.
apple docs
I fixed it by referencing the bridging header in Build Settings.
Under Build Settings, make sure the Objective-C Bridging Header build
setting under Swift Compiler - Code Generation has a path to the
header. The path should be relative to your project, similar to the
way your Info.plist path is specified in Build Settings. In most
cases, you should not need to modify this setting.
I just typed in the name of the bridging header folderName/xxxx-BridgingHeader.h in the field that states bridging header and all was well again.