I'm trying to implement Native UI Components https://facebook.github.io/react-native/docs/native-components-ios.html and when I try to create the following file in Xcode
// RCTMapManager.m
#import <MapKit/MapKit.h>
#import "RCTViewManager.h"
#interface RCTMapManager : RCTViewManager
#end
#implementation RCTMapManager
RCT_EXPORT_MODULE()
- (UIView *)view
{
return [[MKMapView alloc] init];
}
#end
I get the following error
RCTMapManager.m:3:9: 'RCTViewManager.h' file not found
Then I tried to add the following path to the Header Search Path
$(SRCROOT)/../node_modules/react-native/React/**
The previous compilation error is gone but I get the following error when I run the project
2 duplicate symbols for architecture x86_64 clang: error: linker
command failed with exit code 1 (use -v to see invocation)
Any idea ??
I've found the solution to my problem.
Basically there're two problems. First the import should be from "React/RCTViewManager.h" instead of "RCTViewManager".
Second, the class should not be named "RCTMapManager" as this class already exists. It should be named something else (e.g. "RNTMapManager").
Details could be found on the following github issue https://github.com/facebook/react-native/issues/12404 and documentation was fixed with this pull request https://github.com/facebook/react-native/pull/12523
Related
I'm trying to import a font in a Laravel 9 project with tailwind CSS, but I got a missed semicolon error when I run npm run dev. The font is placed in the public/fonts directory, but I have a missing semicolon error when I use the #import directive. I have added in app.css the following line.
#import '../../public/fonts/VerbatimBold.ttf';
Error
[vite] Internal server error: [postcss] postcss-import:
C:\Users\brosa\wa\siti_lavoro\cilaver_laravel\public\fonts\VerbatimBold.ttf:19:255:
Missed semicolon Plugin: vite:css File:
C:/Users/brosa/wa/siti_lavoro/cilaver_laravel/public/fonts/VerbatimBold.ttf:19:255
at Input.error (C:\Users\brosa\wa\siti_lavoro\cilaver_laravel\node_modules\postcss\lib\input.js:148:16)
at Parser.checkMissedSemicolon (C:\Users\brosa\wa\siti_lavoro\cilaver_laravel\node_modules\postcss\lib\parser.js:596:22)
at Parser.decl (C:\Users\brosa\wa\siti_lavoro\cilaver_laravel\node_modules\postcss\lib\parser.js:279:12)
at Parser.other (C:\Users\brosa\wa\siti_lavoro\cilaver_laravel\node_modules\postcss\lib\parser.js:128:18)
at Parser.parse (C:\Users\brosa\wa\siti_lavoro\cilaver_laravel\node_modules\postcss\lib\parser.js:72:16)
at parse (C:\Users\brosa\wa\siti_lavoro\cilaver_laravel\node_modules\postcss\lib\parse.js:11:12)
at new LazyResult (C:\Users\brosa\wa\siti_lavoro\cilaver_laravel\node_modules\postcss\lib\lazy-result.js:133:16)
at Processor.process (C:\Users\brosa\wa\siti_lavoro\cilaver_laravel\node_modules\postcss\lib\processor.js:28:14)
at runPostcss (file:///C:/Users/brosa/wa/siti_lavoro/cilaver_laravel/node_modules/vite/dist/node/chunks/dep-53dc1ef4.js:332:6)
at processContent (file:///C:/Users/brosa/wa/siti_lavoro/cilaver_laravel/node_modules/vite/dist/node/chunks/dep-53dc1ef4.js:326:10)
But I can't understand where the mistake is.
I'm following Mongoose webserver on Github (https://github.com/cesanta/mongoose) and I want to test the websocket sample code.
Here are the codes that I copied:
Unfortunately when I run the code, it returns the following errors:
websocket.obj : error LNK2001: unresolved external symbol _find_embedded_file
C:\ProjectFolder\WebsocketDemo.exe : fatal error LNK1120: 1 unresolved externals
Did I miss something?
The makefile of the examples explain what is missing
There is a rule that generate websocket_html.c that embeded the websocket.html inside a c file (it defines the missing find_embedded_file function).
websocket_html.c: websocket.html
perl mkdata.pl $< > $#
If you prefer to give access to the websocket.html file, this could be done modifying the websocket.c sample
Setting the document_root option
mg_set_option(server, "document_root", ".");
Not handle the html url in the user handler
static int send_reply(struct mg_connection *conn) {
if (conn->is_websocket) {
...
} else {
return MG_FALSE; // mongoose will open file specified by the url
}
}
I'm working on some helpful method in my entity.
private function setApi($api_address,$api_username,$api_password){
$this->api_address = $api_address;
$this->api_username = $api_username;
$this->api_password = $api_password;
$this->api_client = new SoapClient($api_address); // error
}
Warning: require(App/Entity/SoapClient.php): failed to open stream: No such file or directory in /zendboilerplate/library/Doctrine/Common/ClassLoader.php on line 148 Fatal error: require(): Failed opening required 'App/Entity/SoapClient.php' (include_path='/zendboilerplate/application/../library:/zendboilerplate/application/../library/Bisna/Application/Resource:/zendboilerplate/library:.:/usr/share/php:/usr/share/pear') in /zendboilerplate/library/Doctrine/Common/ClassLoader.php on line 148
It seems that zend looks for a class declaration (and it doesn't use included classes in php).
Identical error for each "new Class" declaration.
Using a my own class included in library everything is ok.
(Also tried with #new SoapClient() but no result).
I'm guessing this is namespace related. Try changing the line that is erroring to:
$this->api_client = new \SoapClient($api_address);
that should force it to use the PHP SoapClient instead of the namespace that is presumably declared at the start of the file you're having trouble with.
I have implemented the UrbanAirship in my App(with libUAirship-1.1.1.a).
I have specified the values of
Header_Search_Paths=../Airship/** (as reqursive)
and have not specified any value of
Library_Search_Paths
But i am getting an error like-
ld: library not found for -lUAirship-1.1.1
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1
what can be the solution ? i am waiting for the answer.
Thanks..
There is no need for Library Search Path but you can try with -all_load or -ObjC. else you can try this link. And make sure you have added all the frameworks.
I am currently using blocks in my UIButton category. However I have come across this error which I cannot solve:
error: /usr/include/objc/objc-class.h:
No such file or directory
This is the line of code that uses blocks:
FTButtonBlock block = objc_getAssociatedObject(self, "buttonBlock");
Change
#import <objc/objc-class.h>
to
#import <objc/runtime.h>
From the blog entry: error: objc/objc-class.h: No such file or directory
Replace current line with following line:
#import <objc/runtime.h>
Thanks.
After xcode 4.6 this breaks again. I just fixed this like this :
cd /usr/include/
sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/objc .
Now it works like a charm