failed to import bridging header swift 2 - xcode

I was trying to use SocketIO and Alamofire using cocoapods and started facing this issue. Earlier I added these libraries manually which was working fine.

goto Project->Bulid Setting->Objective-C Bridging Header set "Header.h"... but full path insert
your header file into project group the full path... Like project group name is "XYZ",header file name "Header.h"..set "XYZ/Hrader.h" to Objective-C Bridging Header

There are 3 simple steps to follow,
Add a new Header file into project, using File - > New -> File -> iOS -> Source -> Header File.
Name the class 'your-project-name-Bridging-Header.h'
and press continue to save the file.
Go to Build Settings -> Objective-C Bridging Header and set as ‘your-project-name-Bridging-Header.h’.

If you are using the use_frameworks flag of Cocoapods (which you probably are, since you are using Swift), you have to import like this #import <Reachability/Reachability.h>.
A more general statement would be #import <MODULE/FILE>.

Related

Argument list too long: recursive header expansion failed at react-native-google-cast

I have a problem with building a app in Xcode. When i try to build the app it gives the following error.
Argument list too long: recursive header expansion failed at /Users/******/Documents/******/******/app/native-app/node_modules/react-native-google-cast/ios/../../../ios/build/Build/Intermediates/RNIap.build/Debug-iphonesimulator.
Checkt the repo but no solution found. Who can help me with this so i can build the app.
Info:
RN version: 0.52.0
react-native-google-cast: 2.10.4.1
Xcode: 9.4.1
Thanks,
Yarno
I ran into a similar issue and had to go in and remove a few header search paths, as described here:
https://facebook.github.io/react-native/docs/0.60/troubleshooting#argument-list-too-long-recursive-header-expansion-failed
Argument list too long: recursive header expansion failed
In the
project's build settings, User Search Header Paths and Header Search
Paths are two configs that specify where Xcode should look for #import
header files specified in the code. For Pods, CocoaPods uses a default
array of specific folders to look in. Verify that this particular
config is not overwritten, and that none of the folders configured are
too large. If one of the folders is a large folder, Xcode will attempt
to recursively search the entire directory and throw above error at
some point.
To revert the User Search Header Paths and Header Search Paths build
settings to their defaults set by CocoaPods - select the entry in the
Build Settings panel, and hit delete. It will remove the custom
override and return to the CocoaPod defaults.
(Also cross-posted on this similar issue: Argument list too long: recursive header expansion failed)
Even I faced the same issue in Xcode 10.1, just move your code folder location from desktop, document etc to home folder.

Flow module not found with .scss file

I have a file using scss with css-modules like so:
import styles from './Login.scss';
The webpack build works fine but i'm getting a flow error: Required Module Not Found
In my .flowconfig I have
[ignore]
.*/node_modules/fbjs/.*
.*/app/main.js
.*/app/dist/.*
.*/release/.*
.*/git/.*
[include]
[libs]
[options]
esproposal.class_static_fields=enable
esproposal.class_instance_fields=enable
esproposal.export_star_as=enable
module.name_mapper.extension='css' -> '<PROJECT_ROOT>/flow/CSSModule.js.flow'
module.name_mapper.extension='styl' -> '<PROJECT_ROOT>/flow/CSSModule.js.flow'
module.name_mapper.extension='png' -> '<PROJECT_ROOT>/flow/WebpackAsset.js.flow'
module.name_mapper.extension='jpg' -> '<PROJECT_ROOT>/flow/WebpackAsset.js.flow'
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue
I've also seen https://github.com/facebook/flow/issues/338 but it doesn't really have any solution.
Has anyone found a workaround for this issue?
A better solution for this error is to use the css-modules-flow-types webpack plugin to generate flow types for your CSS modules.
Flow doesn't know about the scss extension, so you need to add the following to your .flowconfig, in the [options] section:
; Extensions
module.file_ext=.js
module.file_ext=.jsx
module.file_ext=.json
module.file_ext=.css
module.file_ext=.scss
You should also add *.scss.flow to your .gitignore. These files shouldn't be checked in because they are automatically generated during the webpack build.
added all the file types I wanted flow to recognize in .flowconfig file
[options]
module.file_ext=.js
module.file_ext=.json
module.file_ext=.jsx
module.file_ext=.css
module.file_ext=.scss
This error can be fixed by assigning .scss files to an empty module. I just npm installed empty and added this to the .flowconfig :
module.name_mapper.extension='scss' -> 'empty/object'
We can use module.name_mapper.extension to replace types for imported module on Object
module.name_mapper.extension - Specify a file extension to match, and a replacement module name,
separated by a ->.
add option to .flowconfig file
// .flowconfig
[options]
module.name_mapper.extension='scss' -> '<PROJECT_ROOT>/flowconfig.mock-module.js'
create new file
// flowconfig.mock-module.js
export default Object;

Use of unresolved identifier GGLContext and GAI

I am having a bit of trouble. I am attempting to install Google Analytics into an app and am consistently getting the use of unresolved identifier GGLContext and GAI error. I receive the same error whether I am using CocoaPods or not. The location of the error is in the AppDelegate.swift here:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
var configureError:NSError?
GGLContext.sharedInstance().configureWithError(&configureError)
assert(configureError == nil, "Error configuring Google services: \(configureError)")
// Optional: configure GAI options.
let gai = GAI.sharedInstance()
gai.trackUncaughtExceptions = true // report uncaught exceptions
return true
}
Nothing additional is able to be imported into the AppDelegate.swift(such as Google), just the standard UIKit.
I have been through many tutorials and other SO questions, all to no avail. I figure that there is some small thing I am missing, but cannot find it.
What I've done:
I have the .h files in my project, along with libGoogleAnalyticsServices.a, libsqlite3.0.tbd, libz.tbd, libsqlite3.tbd (all of which have been linked to library as well as CoreData and SystemConfiguration).
You can see the layout of all these files here:
and here:
I have created the -Bridging-Header.h and included these .h imports in it.
#import "GAI.h"
#import "GAIDictionaryBuilder.h"
#import "GAIEcommerceFields.h"
#import "GAIEcommerceProduct.h"
#import "GAIEcommerceProductAction.h"
#import "GAIEcommercePromotion.h"
#import "GAIFields.h"
#import "GAILogger.h"
#import "GAITrackedViewController.h"
#import "GAITracker.h"
The -Bridging-Header.h is linked in the Build Settings and I receive no errors with that. That is the main solution that I have found during my research, which hasn't helped me in this situation.
I have tried to start over from scratch twice with CocoaPods and without (I made a copy of my project before starting) and I received the same error each time.
Any help would certainly be appreciated. Thanks in advance.
Well, it looks like I was able to get it squared away.
There were several problems with all attempts on this.
Cocoapods had not installed correctly. I reinstalled and then had better success importing the correct files.
Doing it manually, as I posted above is not the best option.
After the Cocoapods re-install and starting over from a fresh copy of my project, I was able to import Google into my AppDelegate.swift.
Key points for those who may end up in the same boat I was in:
Be sure to add the correct directory for your -Bridging-Header.h. You can find this under Project - Build Settings - Swift Compiler Code Generation. Use this to easily target your header file $(SWIFT_MODULE_NAME)-Bridging-Header.h
In your -Bridging-Header.h, do not #import <Google/Analytics.h>, instead import the files individually. Here is an image of the files available to be imported.
When in doubt, reinstall Cocoapods
Do not trust Google tutorials to provide the most effective instruction and utilize the many SO posts on the topic.
I really hope this helps someone not spend 10 hours on the problem as I have.
Swift 4.0 and xcode 9.0.1 finally I resolved.
For me after 2 days I resolved.. Don't follow Google's old documentation says #import <Google/Analytics.h>
Go to Terminal type pod init
Reopen project as workspace obvious after pod workspace is created, open podfile. write pod 'GoogleAnalytics' in your pod file before target 'GoogleAnalytics' do
Go back to Terminal pod install you will find frameworks GAI.h and other files will be there under pods folder
Create Header.h file to your root. Don't add #import <Google/Analytics.h> instead import following individually in bridging header file
e.g. in bridging header file remove #import <Google/Analytics.h>
#import GAI.h
#import "GAITracker.h"
#import "GAIFields.h"
#import "GAIDictionaryBuilder.h"
Point your bridge under Build Settings for target Swift Compiler - General -> Objective-C Bridging Header. write Header.h of your bridging file name
Add code from google for swift to didFinishLaunchingWithOptions Don't forget to replace your tracking id from Google Analytics page
guard let gai = GAI.sharedInstance() else {
assert(false, "Google Analytics not configured correctly")
}
gai.tracker(withTrackingId: "YOUR_TRACKING_ID")
// Optional: automatically report uncaught exceptions.
gai.trackUncaughtExceptions = true
// Optional: set Logger to VERBOSE for debug information.
// Remove before app release.
gai.logger.logLevel = .verbose;
Tada.... Run your project...
My error was use of unresolved identifier when i was using the singleton GAI.sharedInstance().
My steps to bring this to work were:
add pod 'Google/Analytics'
pod install
restart xcode
create a objc class in my project to get a bridging header
added #import "GAI.h" in to the bridging header file
everything works perfectly.
This works for swift 2.3, swift 3.0 and swift 4:
add the GoogleService-Info.plist file to the root of your project
add this to the podfile:
pod 'Google/Analytics'
quit Xcode, run "pod install" in terminal and open Xcode again
create a header file in the project root, named Bridging-Header.h, under build settings make sure the bridging header is defined like in the picture
make sure your Bridging-Header.h looks like this:
#ifndef Bridging_Header_h
#define Bridging_Header_h
#import <Google/Analytics.h>
#endif /* Bridging_Header_h */
add to AppDelegate:
import Google
add this code to AppDelegate in the didFinishLaunchingWithOptions method:
// Configure tracker from GoogleService-Info.plist.
var configureError: NSError?
GGLContext.sharedInstance().configureWithError(&configureError)
assert(configureError == nil, "Error configuring Google services:\(configureError)")
// Optional: configure GAI options.
guard let gai = GAI.sharedInstance() else {
assert(false, "Google Analytics not configured correctly")
}
gai.trackUncaughtExceptions = true // report uncaught exceptions
gai.logger.logLevel = GAILogLevel.Verbose // remove before app release
If there are errors, deleting DerivedData and cleaning the project can help.
The only way to make it work for me was downgrade Google Analytics pod version to 2.0.4.
pod 'Google/Analytics', '~> 2.0.4'

Qt5 MediaPlayer setMedia use http in macos

i want to play a mp3 using a http url,so i found Qt5 MediaPlayer. But i get a issue,when i set player->setMedia(QUrl('http://xxx'));.
2016-01-02 01:46:02.544 myPlayer[82519:5587404] App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.
i found this, but i don't know how to add NSAllowsArbitraryLoads to info.plist.
You should create info.plist file for your application. Then at your .pro file add this:
QMAKE_INFO_PLIST = Info.plist
From Qt documentation:
QMAKE_INFO_PLIST
Specifies the name of the property list file, .plist, you would like
to include in your OS X and iOS application bundle.
In the .plist file, you can define some variables, e.g., #EXECUTABLE#,
which qmake will replace with the actual executable name. Other
variables include #ICON#, #TYPEINFO#, #LIBRARY#, and #SHORT_VERSION#.

borland c unable to include header file

I have a very old C project that must be opened using borlandc. my machine runs win 8 so I have installed dosbox to run borlandc
the problem is that when i build the project, there exist too many errors, all are in the form: "unable to include file "xxx.h"
kindly be noted that:
- all these header files are existing in the INCLUDE folder
- I have created the cfg file and set the correct path to that folder for the compiler, so as for the linker
- I have set the environment variables
and still have the same errors
can anyone help me with that?
Check the bcc32.cfgfile.It must be in the same directory as that of the bcc32.exe file..
Check this here.

Resources