Xcode Plugin header files not found

Xcode Plugin header files not found
0.0 0

#1

I’m working in Cocos2d-x 3.10 (C++) with the latest version of XCode. Anytime I try to include a Plugin header file, XCode prompts the error that the Plugin header file was not found. I installed the SDKBox GUI, and tried installing AdMob. With the this following line of code I get " ‘PluginAdMob/PluginAdMob.h’ file not found" :

#include "PluginAdMob/PluginAdMob.h"

I’ve tried other plugins such as the Facebook plugi, and even creating new Cocos2d-x programs, then adding plugins to the project on creation (in cocos2d-x gui). I’ve tried searching and found a couple of answers saying to reinstall the plugin, or add the plugin to the Build Phases/Link Binary With Libraries, but no luck.

I appreciate any help in advance!


#2

Did you add the required libraries for AdMob, etc?


#3

I believe so. The first three listed are shown inside of my projects/_ios_mac folder, if that makes a difference. The rest (and previous) are shown inside of my XCode project. Here are the frameworks included in my project:

sdkbox.framework
PluginAdMob.framework
GoogleMobileAds.framework

AdSupport.framework
AudioToolbox.framework
AVFoundation.framework
CoreGraphics.framework
CoreMedia.framework
CoreTelephony.framework
EventKit.framework
EventKitUI.framework
MessageUI.framework
StoreKit.framework
SystemConfiguration.framework
GameController.framework
MediaPlayer.framework

I believe the problem to be with linking framework header files to any of my class files.

I tried following this github rep. : https://github.com/sdkbox/sdkbox-sample-admob


#4

are there any linker flags that you missed?


#5

Here are my linked libraries. Incase you meant something other than the this, I did try searching and found something on “Other Linker flags”, which I’ve never messed with. I see something about modifying them in this post: Linking errors when adding AdMob to IOS cocos2d-x 3.2, but I’m not sure how to do that as my XCode Build settings looks different for that section only allowing me to add under debug and release.

Also, thank you very much for your help so far slackmoehrle!


#6

I’m not current on SDKBOX, but verify the header is correct… meaning .h vs .hpp. I honestly don’t recall the naming convention. If I can get a few minutes I will try the gui with a new project and see if I run into any difficulty.


#7

Are you building mac probject instead of iOS?


#8

I did check the naming convention, and I also tried creating a new project without using the sdkbox (unless cocos2d uses it with the GUI). Here’s a picture of a new project still showing the error. Also, Nite, I’m not sure I even knew there was a mac project option, but thank you both for your replies!


#9

You are using the cocos gui. I might not use that anymore. It only supports v3.10 (without some manual work.).

Just use cocos from a command-line and the SDKBOX installer.


#10

Check your build target


#11

The build target shouldn’t be a problem, as I’ve been able to run the app without trying to include the header. I just downloaded the newest version of cocos2d-x and am going to try it out this weekend and see if it solves my problem.

Also I’ve tried using #ifdef SDK_ENABLED, and it seems that SDK_ENABLED is not defined, I’m not sure if that could affect my problem at all, but thought it may be worth mentioning.

UPDATE:

So, I am truly not sure what happened or how this was solved, but I opened my original project up today and only tried adding the include and it worked. I really wish I could provide some explanation incase anyone else has the problem, but the only thing I can think is that my computer was restarted and it somehow allowed it to work. If I figure out how I solved this any better, I will definitely post it here!

Thank you Slackmoehrle and Nite for your responses and help! I most definitely appreciate you answers!


#12

While I thought I resolved this issue, I actually did not, but I did find the problem. When I try to include framework in my AppDelegate, that’s when I have the problem. However, if I include it in any other of my source files, I don’t have the problem. Is there a reason why I cannot include frameworks in the appdelegate? That is how the sample project shows the admob framework being used. My appdelegate.cpp and .h file are in the same directory.


#13

I have some problem. But i used a trick i think it temporary solving that include “PluginAdMob/PluginAdMob.h” in other header then in Appdelegate you include that bridge header. Although there is a error when calling sdk init but you still can build the project, dont know why.


#14

Hi nite I’m having same problem in my case I’m not getting error in including PluginAdMob/PluginAdMob.h in AppDelegate. But getting error PluginAdMob/PluginAdMob.h file not found in other source file.

I’m working on latest sdkbox installer and cocos2dx 3.12 version on Xcode.

Please help me.


#15

Hi Nite I solved it by adding framework manually. But when I run I got many errors:-

“_SCNetworkReachabilityUnscheduleFromRunLoop”, referenced from:

  -[SdkboxReachability stopNotifier] in sdkbox(Reachability.o)

“_SCNetworkReachabilityGetFlags”, referenced from:

  -[SdkboxReachability connectionRequired] in sdkbox(Reachability.o)


  -[SdkboxReachability currentReachabilityStatus] in sdkbox(Reachability.o)

OBJC_CLASS$_GADInterstitial”, referenced from:

  objc-class-ref in PluginAdMob(AdMobWrapper-E90EA116FA88C67.o)

“_SCNetworkReachabilitySetCallback”, referenced from:

  -[SdkboxReachability startNotifier] in sdkbox(Reachability.o)

“_SCNetworkReachabilityCreateWithName”, referenced from:

  +[SdkboxReachability reachabilityWithHostName:] in sdkbox(Reachability.o)

“_SCNetworkReachabilityCreateWithAddress”, referenced from:

  +[SdkboxReachability reachabilityWithAddress:] in sdkbox(Reachability.o)

“_SCNetworkReachabilityScheduleWithRunLoop”, referenced from:

  -[SdkboxReachability startNotifier] in sdkbox(Reachability.o)

“_kGADAdSizeBanner”, referenced from:

  sdkbox::AdMobWrapperEnabled::cache(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in PluginAdMob(AdMobWrapper-E90EA116FA88C67.o)

OBJC_CLASS$_ASIdentifierManager”, referenced from:

  objc-class-ref in PluginAdMob(AdMobWrapper-E90EA116FA88C67.o)

OBJC_CLASS$_GADRequest”, referenced from:

  objc-class-ref in PluginAdMob(AdMobWrapper-E90EA116FA88C67.o)

OBJC_CLASS$_GADBannerView”, referenced from:

  objc-class-ref in PluginAdMob(AdMobWrapper-E90EA116FA88C67.o)

“_IsGADAdSizeValid”, referenced from:

  sdkbox::AdMobWrapperEnabled::cache(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in PluginAdMob(AdMobWrapper-E90EA116FA88C67.o)

“_GADAdSizeFromCGSize”, referenced from:

  sdkbox::AdMobWrapperEnabled::cache(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in PluginAdMob(AdMobWrapper-E90EA116FA88C67.o)

ld: symbol(s) not found for architecture armv7

clang: error: linker command failed with exit code 1 (use -v to see invocation)

Thanks.


#16

Looks like your project is missing sdkbox.framework